#1774 closed defect (invalid)
mis computed ref in filters for manytomany
| Reported by: | 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: | no | UI/UX: | no |
Description
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}
Note:
See TracTickets
for help on using tickets.
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.