Django

Code

Show
Ignore:
Timestamp:
04/26/08 21:50:16 (7 months ago)
Author:
mtredinnick
Message:

Merged the queryset-refactor branch into trunk.

This is a big internal change, but mostly backwards compatible with existing
code. Also adds a couple of new features.

Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/null_queries/models.py

    r5876 r7477  
    1515 
    1616__test__ = {'API_TESTS':""" 
    17 # Regression test for the use of None as a query value. None is interpreted as  
     17# Regression test for the use of None as a query value. None is interpreted as 
    1818# an SQL NULL, but only in __exact queries. 
    1919# Set up some initial polls and choices 
     
    2525>>> c2.save() 
    2626 
    27 # Exact query with value None returns nothing (=NULL in sql) 
    28 >>> Choice.objects.filter(id__exact=None) 
     27# Exact query with value None returns nothing ("is NULL" in sql, but every 'id' 
     28# field has a value). 
     29>>> Choice.objects.filter(choice__exact=None) 
    2930[] 
    3031 
     32Excluding the previous result returns everything. 
     33>>> Choice.objects.exclude(choice=None).order_by('id') 
     34[<Choice: Choice: Because. in poll Q: Why? >, <Choice: Choice: Why Not? in poll Q: Why? >] 
     35 
    3136# Valid query, but fails because foo isn't a keyword 
    32 >>> Choice.objects.filter(foo__exact=None)  
     37>>> Choice.objects.filter(foo__exact=None) 
    3338Traceback (most recent call last): 
    3439... 
    35 TypeError: Cannot resolve keyword 'foo' into field. Choices are: id, poll, choice 
     40FieldError: Cannot resolve keyword 'foo' into field. Choices are: choice, id, poll 
    3641 
    3742# Can't use None on anything other than __exact