Backwards-incompatible change -- Removed LazyDate helper class. To preserve existing functionality, query arguments can now be callable. Callable query arguments are evaluated with the query is evaluated.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2007-04-09 13:28:09 +00:00
parent 17fac1b09b
commit bbeb62c9af
4 changed files with 8 additions and 35 deletions

View file

@ -826,7 +826,9 @@ def parse_lookup(kwarg_items, opts):
# Interpret '__exact=None' as the sql '= NULL'; otherwise, reject
# all uses of None as a query value.
if lookup_type != 'exact':
raise ValueError, "Cannot use None as a query value"
raise ValueError, "Cannot use None as a query value"
elif callable(value):
value = value()
joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts, opts.db_table, None)
joins.update(joins2)