Django

Code

Show
Ignore:
Timestamp:
08/28/08 00:00:23 (3 months ago)
Author:
mtredinnick
Message:

Improvements to [8608] to fix an infinite loop (for exclude(generic_relation)).
Also comes with approximately 67% less stupidity in the table joins for
filtering on generic relations.

Fixed #5937, hopefully for good, this time.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/generic_relations/models.py

    r8608 r8644  
    132132 
    133133# Queries across generic relations respect the content types. Even though there are two TaggedItems with a tag of "fatty", this query only pulls out the one with the content type related to Animals. 
     134>>> Animal.objects.order_by('common_name') 
     135[<Animal: Lion>, <Animal: Platypus>] 
    134136>>> Animal.objects.filter(tags__tag='fatty') 
    135137[<Animal: Platypus>] 
     138>>> Animal.objects.exclude(tags__tag='fatty') 
     139[<Animal: Lion>] 
    136140 
    137141# If you delete an object with an explicit Generic relation, the related