Django

Code

Show
Ignore:
Timestamp:
08/29/08 23:52:56 (3 months ago)
Author:
mtredinnick
Message:

[8721] introduced some internal field names. We hide them from the list of
valid field names in debugging output so that it doesn't confuse things.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/options.py

    r8616 r8730  
    281281        """ 
    282282        Returns a list of all field names that are possible for this model 
    283         (including reverse relation names). 
     283        (including reverse relation names). This is used for pretty printing 
     284        debugging output (a list of choices), so any internal-only field names 
     285        are not included. 
    284286        """ 
    285287        try: 
     
    289291        names = cache.keys() 
    290292        names.sort() 
    291         return names 
     293        # Internal-only names end with "+" (symmetrical m2m related names being 
     294        # the main example). Trim them. 
     295        return [val for val in names if not val.endswith('+')] 
    292296 
    293297    def init_name_map(self):