diff options
-rw-r--r-- | program/admin.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/program/admin.py b/program/admin.py index 9c744e3..e588b87 100644 --- a/program/admin.py +++ b/program/admin.py @@ -28,13 +28,13 @@ class NoteAdmin(admin.ModelAdmin): ordering = ('timeslot',) def queryset(self, request): - return super(NoteAdmin, self).queryset(request).filter(owner=request.user) + shows = request.user.shows.all() + return super(NoteAdmin, self).queryset(request).filter(show__in=shows) def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == 'timeslot': - one_year_ago = datetime.today() - timedelta(days=365) shows = request.user.shows.all() - kwargs['queryset'] = TimeSlot.objects.filter(show__in=shows, start__gt=one_year_ago) + kwargs['queryset'] = TimeSlot.objects.filter(show__in=shows) return super(NoteAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs) |