diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-07-24 16:52:57 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-07-24 16:52:57 (GMT) |
commit | fe0765b3b9f91d49b7b053765e377f5106958b80 (patch) | |
tree | ca2af542ac5ee079de42edfa623e810e76b44629 | |
parent | bc7ef81c4afbcc7f1591da9615c9f4443cfb59c6 (diff) |
fixed filters for note admin.
-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) |