Opened 8 years ago

Closed 8 years ago

#3276 closed defect (invalid)

__in lookup broken within exclude()

Reported by: anonymous Owned by: adrian
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: UI/UX:

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 Changed 8 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed

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