Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#8805 closed (fixed)

TypeError: sequence expected, int found

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


class Brand(models.Model):
    geo = models.ForeignKey(Geo,
           limit_choices_to={'level__exact' : 0},

Caught an exception while rendering: sequence expected, int found

Original Traceback (most recent call last):

File "/opt/elec-devel/python/django/template/", line 71, in render_node

result = node.render(context)

File "/opt/elec-devel/python/django/template/", line 87, in render

output = force_unicode(self.filter_expression.resolve(context))

File "/opt/elec-devel/python/django/utils/", line 49, in force_unicode

s = unicode(s)

File "/opt/elec-devel/python/django/forms/", line 326, in unicode

return self.as_widget()

File "/opt/elec-devel/python/django/forms/", line 358, in as_widget

return widget.render(name, data, attrs=attrs)

File "/opt/elec-devel/python/django/contrib/admin/", line 109, in render

params = self.url_parameters()

File "/opt/elec-devel/python/django/contrib/admin/", line 134, in url_parameters

params = self.base_url_parameters()

File "/opt/elec-devel/python/django/contrib/admin/", line 129, in base_url_parameters

params.update(dict([(k, ','.join(v)) for k, v in self.rel.limit_choices_to.items()]))

TypeError: sequence expected, int found

Change History (5)

comment:1 Changed 10 years ago by anonymous


limit_choices_to={'status__gte' : 3}

is works.

comment:2 Changed 10 years ago by Mikhail Mitrofanov

class BrandAdmin(admin.ModelAdmin):
  raw_id_fields = ('geo',)

comment:3 Changed 10 years ago by Brian Rosner

milestone: 1.0

comment:4 Changed 10 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

(In [8867]) 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.

comment:5 Changed 7 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top