Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1774 closed defect (invalid)

mis computed ref in filters for manytomany

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


using QuerySet filter in the newest svn tree (as of May 5 2006)

a Manytomany filter

Q = Item.objects.filter({manytomanyfield} = {ManyToManyObj})

results in a SQL error of
Unknown column 'm2m_{site}_item{manytomanfield}.{manytomany} = {id}' in 'where clause'

the SQL should be m2m_{site}_item{manytomanfield}.{manytomany}_id = {id}

Change History (1)

comment:1 Changed 12 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

filter() doesn't take many-to-many objects as parameters. You'll have to select based on the ID of the object you're looking for.

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