Author: brosner
Date: 2008-09-02 13:57:10 -0500 (Tue, 02 Sep 2008)
New Revision: 8867
Modified:
django/trunk/django/contrib/admin/widgets.py
Log:
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.
Modified: django/trunk/django/contrib/admin/widgets.py
===================================================================
--- django/trunk/django/contrib/admin/widgets.py 2008-09-02 18:45:33 UTC
(rev 8866)
+++ django/trunk/django/contrib/admin/widgets.py 2008-09-02 18:57:10 UTC
(rev 8867)
@@ -126,7 +126,14 @@
def base_url_parameters(self):
params = {}
if self.rel.limit_choices_to:
- params.update(dict([(k, ','.join(v)) for k, v in
self.rel.limit_choices_to.items()]))
+ items = []
+ for k, v in self.rel.limit_choices_to.items():
+ if isinstance(v, list):
+ v = [str(x) for x in v]
+ else:
+ v = str(v)
+ items.append((k, ','.join(v)))
+ params.update(dict(items))
return params
def url_parameters(self):
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---