diff --git a/django_lostplaces/lostplaces/models/models.py b/django_lostplaces/lostplaces/models/models.py index 8dd2f57..d21b024 100644 --- a/django_lostplaces/lostplaces/models/models.py +++ b/django_lostplaces/lostplaces/models/models.py @@ -88,15 +88,15 @@ class Explorer(models.Model): and the list views ''' if self.user.is_superuser: - return Place.objects.filter(mode='live') + return Place.objects.filter(mode='live').order_by('submitted_when') - return Place.objects.filter( + return (Place.objects.filter( level__lte=self.level, mode='live' ) | Place.objects.filter( submitted_by=self, mode='live' - ) + )).order_by('submitted_when') def get_places_eligible_to_see(self): if self.user.is_superuser: @@ -110,6 +110,12 @@ class Explorer(models.Model): place in self.get_places_eligible_to_see() ) + def get_drafts(self): + return Place.objects.filter( + submitted_by=self, + mode='draft' + ) + def __str__(self): return self.user.username