Opened 18 years ago

Closed 18 years ago

#3276 closed defect (invalid)

__in lookup broken within exclude()

Reported by: anonymous Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal 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

This doesn't seem right:

this works OK:

In [11]: qset.exclude( id__in=list(range(10) ) ).count()
Out[11]: 44L

this is what's wrong:

In [12]: len( list( qset.exclude( id__in=list(range(10) ) ) ) )
Out[12]: 2288

the actual data from DB is repeated over and over 52times...
even when I iterate over it in a template...

Change History (1)

comment:1 by anonymous, 18 years ago

Resolution: invalid
Status: newclosed

sorry guys, mistake on my side:

I had related_table.column specified in Meta.ordering - that worked fine, until I removed my custom manager that appended select_related() to the default queryset, therefore it resulted in a cross join...

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