Code

Changes between Initial Version and Version 10 of Ticket #3096


Ignore:
Timestamp:
11/09/07 10:47:39 (6 years ago)
Author:
gwilson
Comment:

formatted ticket description

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3096

    • Property Cc myer0052@… added
    • Property Patch needs improvement set
    • Property Version changed from SVN to newforms-admin
    • Property Milestone changed from Version 1.0 to
    • Property Has patch set
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #3096 – Description

    initial v10  
    33For example, if we have 
    44 
     5{{{ 
     6#!python 
    57class Color(models.Model): 
    68    value=models.CharField(...) 
     
    1214    class Admin: 
    1315        list_filter = ('color',) 
     16}}} 
    1417 
    1518We will get all the choices of Color objects listed in the Filter/By Color section instead of getting only those, which are warm. 
     
    1720To fix this, the line 
    1821{{{ 
     22#!python 
    1923self.lookup_choices = f.rel.to._default_manager.all() 
    2024}}} 
    2125at class RelatedFilterSpec(FilterSpec) in the file django/contrib/admin/filterspecs.py has to be changed to 
    2226{{{ 
     27#!python 
    2328if f.rel.limit_choices_to: 
    2429    self.lookup_choices = f.rel.to._default_manager.filter(**f.rel.limit_choices_to)