mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
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:
parent
17fac1b09b
commit
bbeb62c9af
4 changed files with 8 additions and 35 deletions
|
@ -734,10 +734,10 @@ relationship should work. All are optional:
|
|||
``limit_choices_to`` A dictionary of lookup arguments and values (see
|
||||
the `Database API reference`_) that limit the
|
||||
available admin choices for this object. Use this
|
||||
with ``models.LazyDate`` to limit choices of objects
|
||||
by date. For example::
|
||||
with functions from the Python ``datetime`` module
|
||||
to limit choices of objects by date. For example::
|
||||
|
||||
limit_choices_to = {'pub_date__lte': models.LazyDate()}
|
||||
limit_choices_to = {'pub_date__lte': datetime.now}
|
||||
|
||||
only allows the choice of related objects with a
|
||||
``pub_date`` before the current date/time to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue