1
0
mirror of https://github.com/django/django.git synced 2025-05-02 21:24:39 +00:00

Made small improvement to function_get_date_list

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-30 04:13:00 +00:00
parent ee350b09dd
commit b4af15e66c

View File

@ -1665,10 +1665,7 @@ def function_get_date_list(opts, field, *args, **kwargs):
from django.core.db.typecasts import typecast_timestamp from django.core.db.typecasts import typecast_timestamp
kind = args and args[0] or kwargs['kind'] kind = args and args[0] or kwargs['kind']
assert kind in ("month", "year", "day"), "'kind' must be one of 'year', 'month' or 'day'." assert kind in ("month", "year", "day"), "'kind' must be one of 'year', 'month' or 'day'."
order = 'ASC' order = kwargs.pop('_order', 'ASC')
if kwargs.has_key('_order'):
order = kwargs['_order']
del kwargs['_order']
assert order in ('ASC', 'DESC'), "'order' must be either 'ASC' or 'DESC'" assert order in ('ASC', 'DESC'), "'order' must be either 'ASC' or 'DESC'"
kwargs['order_by'] = [] # Clear this because it'll mess things up otherwise. kwargs['order_by'] = [] # Clear this because it'll mess things up otherwise.
if field.null: if field.null: