Changes between Initial Version and Version 2 of Ticket #23624


Ignore:
Timestamp:
Oct 9, 2014, 9:53:02 AM (10 years ago)
Author:
Ludovico Magnocavallo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23624 – Description

    initial v2  
    55I am attaching a sample models.py file that illustrates the issue. I have not yet found the time to delve into what's happening, I hope someone with a better understanding of all the related stuff steps in as it's something I have never looked into.
    66
     7What happens is that the manager seems to ignore the through model, here is the traceback (actual call and models in the attached file):
    78
     9
     10{{{
     11Traceback (most recent call last):
     12  File "<console>", line 1, in <module>
     13  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/manager.py", line 191, in all
     14    return self.get_queryset()
     15  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 887, in get_queryset
     16    return qs._next_is_sticky().filter(**self.core_filters)
     17  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/query.py", line 691, in filter
     18    return self._filter_or_exclude(False, *args, **kwargs)
     19  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/query.py", line 709, in _filter_or_exclude
     20    clone.query.add_q(Q(*args, **kwargs))
     21  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1287, in add_q
     22    clause, require_inner = self._add_q(where_part, self.used_aliases)
     23  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1314, in _add_q
     24    current_negated=current_negated, connector=connector)
     25  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1138, in build_filter
     26    lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
     27  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1076, in solve_lookup_type
     28    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
     29  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1383, in names_to_path
     30    self.raise_field_error(opts, name)
     31  File "/home/ludo/Desktop/dev/venv/spritz/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1389, in raise_field_error
     32    "Choices are: %s" % (name, ", ".join(available)))
     33FieldError: Cannot resolve keyword u'a' into field. Choices are: a_s, id, name
     34
     35}}}
     36
     37
     38
Back to Top