Ticket #7881: raw_id_limit_choices_admin.diff
File raw_id_limit_choices_admin.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/views/main.py
179 179 del lookup_params[key] 180 180 lookup_params[smart_str(key)] = value 181 181 182 # if key ends with __in, split parameter into separate values 183 if key.endswith('__in'): 184 lookup_params[key] = value.split(',') 185 182 186 # Apply lookup parameters from the query string. 183 187 qs = qs.filter(**lookup_params) 184 188 -
django/contrib/admin/widgets.py
102 102 def render(self, name, value, attrs=None): 103 103 related_url = '../../../%s/%s/' % (self.rel.to._meta.app_label, self.rel.to._meta.object_name.lower()) 104 104 if self.rel.limit_choices_to: 105 url = '?' + '&'.join(['%s=%s' % (k, v) for k, v in self.rel.limit_choices_to.items()])105 url = '?' + '&'.join(['%s=%s' % (k, ','.join(v)) for k, v in self.rel.limit_choices_to.items()]) 106 106 else: 107 107 url = '' 108 108 if not attrs.has_key('class'):