Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 577640bd04117573805d8b9ffa4670b999714db4 1 parent 58e3ef7
Brian Rosner authored September 02, 2008

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  django/contrib/admin/widgets.py
9  django/contrib/admin/widgets.py
@@ -126,7 +126,14 @@ def render(self, name, value, attrs=None):
126 126
     def base_url_parameters(self):
127 127
         params = {}
128 128
         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))
130 137
         return params    
131 138
     
132 139
     def url_parameters(self):

0 notes on commit 577640b

Please sign in to comment.
Something went wrong with that request. Please try again.