Django

Code

Changeset 8867

Show
Ignore:
Timestamp:
09/02/08 13:57:10 (4 months ago)
Author:
brosner
Message:

Fixed #8805 -- Make sure proper type coercion happens before dumping data into join for limit_choices_to when building the URL parameters for the ForeignKeyRawIdWidget? popup.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/admin/widgets.py

    r8846 r8867  
    127127        params = {} 
    128128        if self.rel.limit_choices_to: 
    129             params.update(dict([(k, ','.join(v)) for k, v in self.rel.limit_choices_to.items()])) 
     129            items = [] 
     130            for k, v in self.rel.limit_choices_to.items(): 
     131                if isinstance(v, list): 
     132                    v = [str(x) for x in v] 
     133                else: 
     134                    v = str(v) 
     135                items.append((k, ','.join(v))) 
     136            params.update(dict(items)) 
    130137        return params     
    131138