Opened 18 years ago

Last modified 13 years ago

#2331 closed defect

Related Field has invalid lookup: icontains — at Version 1

Reported by: ian@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: gmludo@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

just upgraded to the latest head, and found this.
I could have sworn it was working beforehand.

Traceback (most recent call last):
File "/home/data/py/django/core/handlers/base.py" in get_response
  74. response = callback(request, *callback_args, **callback_kwargs)
File "/home/data/py/zilbo/common/utils/views/filter.py" in _wrapper
  37. return generic(request, queryset.filter(**filter), *args, **kw)
File "/home/data/py/django/views/generic/list_detail.py" in object_list
  45. object_list = paginator.get_page(page - 1)
File "/home/data/py/django/core/paginator.py" in get_page
  36. object_list = list(self.query_set[offset:offset+limit])
File "/home/data/py/django/db/models/query.py" in __iter__
  103. return iter(self._get_data())
File "/home/data/py/django/db/models/query.py" in _get_data
  430. self._result_cache = list(self.iterator())
File "/home/data/py/django/db/models/query.py" in iterator
  171. select, sql, params = self._get_sql_clause()
File "/home/data/py/django/db/models/query.py" in _get_sql_clause
  444. joins2, where2, params2 = self._filters.get_sql(opts)
File "/home/data/py/django/db/models/query.py" in get_sql
  574. joins2, where2, params2 = val.get_sql(opts)
File "/home/data/py/django/db/models/query.py" in get_sql
  622. return parse_lookup(self.kwargs.items(), opts)
File "/home/data/py/django/db/models/query.py" in parse_lookup
  734. joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts, opts.db_table, None)
File "/home/data/py/django/db/models/query.py" in lookup_inner
  906. params.extend(field.get_db_prep_lookup(lookup_type, value))
File "/home/data/py/django/db/models/fields/related.py" in get_db_prep_lookup
  105. raise TypeError, "Related Field has invalid lookup: %s" % lookup_type

  TypeError at /asset/machine/
  Related Field has invalid lookup: icontains

Change History (1)

comment:1 by Malcolm Tredinnick, 18 years ago

Description: modified (diff)

Could you provide an example of what you were doing to trigger this error, please. It is impossible to work it out just from the traceback. A model and a query against it that fails reliably would be nice. Thanks.

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