Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#9484 closed (duplicate)

Admin, raw_id_fields, not int value

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

Description

In admin, raw_id_fields
whet typed not integer value:

Traceback (most recent call last):

File "/opt/elec/python/django/core/handlers/base.py", line 86, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/opt/elec/python/django/contrib/admin/sites.py", line 158, in root
return self.model_page(request, *url.split('/', 2))

File "/opt/elec/python/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

File "/opt/elec/python/django/contrib/admin/sites.py", line 177, in model_page
return admin_obj(request, rest_of_url)

File "/opt/elec/python/django/contrib/admin/options.py", line 191, in __call__
return self.add_view(request)

File "/opt/elec/python/django/db/transaction.py", line 238, in _commit_on_success
res = func(*args, **kw)

File "/opt/elec/python/django/contrib/admin/options.py", line 490, in add_view
if form.is_valid():

File "/opt/elec/python/django/forms/forms.py", line 120, in is_valid
return self.is_bound and not bool(self.errors)

File "/opt/elec/python/django/forms/forms.py", line 111, in _get_errors
self.full_clean()

File "/opt/elec/python/django/forms/forms.py", line 224, in full_clean
value = field.clean(value)

File "/opt/elec/python/django/forms/models.py", line 650, in clean
value = self.queryset.get(**{key: value})

File "/opt/elec/python/django/db/models/query.py", line 297, in get
clone = self.filter(*args, **kwargs)

File "/opt/elec/python/django/db/models/query.py", line 483, in filter
return self._filter_or_exclude(False, *args, **kwargs)

File "/opt/elec/python/django/db/models/query.py", line 501, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))

File "/opt/elec/python/django/db/models/sql/query.py", line 1224, in add_q
can_reuse=used_aliases)

File "/opt/elec/python/django/db/models/sql/query.py", line 1167, in add_filter
self.where.add((alias, col, field, lookup_type, value), connector)

File "/opt/elec/python/django/db/models/sql/where.py", line 48, in add
params = field.get_db_prep_lookup(lookup_type, value)

File "/opt/elec/python/django/db/models/fields/__init__.py", line 202, in get_db_prep_lookup
return [self.get_db_prep_value(value)]

File "/opt/elec/python/django/db/models/fields/__init__.py", line 353, in get_db_prep_value
return int(value)

UnicodeEncodeError: 'decimal' codec can't encode character u'\u041f' in position 0: invalid decimal Unicode string

Change History (1)

comment:1 by Karen Tracey, 16 years ago

Resolution: duplicate
Status: newclosed

#8746 covers this.

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