Ticket #3096: 3096-filterspecs.patch
File 3096-filterspecs.patch, 786 bytes (added by , 18 years ago) |
---|
-
django/contrib/admin/filterspecs.py
56 56 self.lookup_title = f.verbose_name 57 57 self.lookup_kwarg = '%s__%s__exact' % (f.name, f.rel.to._meta.pk.name) 58 58 self.lookup_val = request.GET.get(self.lookup_kwarg, None) 59 self.lookup_choices = f.rel.to._default_manager.all() 59 if f.rel.limit_choices_to: 60 self.lookup_choices = f.rel.to._default_manager.filter(**f.rel.limit_choices_to) 61 else: 62 self.lookup_choices = f.rel.to._default_manager.all() 60 63 61 64 def has_output(self): 62 65 return len(self.lookup_choices) > 1