When I set up a date_hierarchy on a DateField that has NULL values,
the admin interface won't let me focus below year; when I click on a
month, I get redirected to a URL ending in ?e=1.
I'm using Django 1.0, sqlite3 (3.4.0). Here's the field definition:
purchaseDate = models.DateField("Purchase Date", blank=True,
null=True, default=datetime.now)
If I apply patch #3501 (http://code.djangoproject.com/ticket/3501),
the problem goes away.
Looking at the bottom of #3501, I can verify that __year works as
described without the patch, but I get an error if I search by __month
instead:
>>> Album.objects.filter(purchaseDate__month=3)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 144, in __repr__
return repr(list(self))
File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 156, in __len__
self._result_cache.extend(list(self._iter))
File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 269, in iterator
for row in self.query.results_iter():
File "/Library/Python/2.5/site-packages/django/db/models/sql/
query.py", line 206, in results_iter
for rows in self.execute_sql(MULTI):
File "/Library/Python/2.5/site-packages/django/db/models/sql/
query.py", line 1700, in execute_sql
cursor.execute(sql, params)
File "/Library/Python/2.5/site-packages/django/db/backends/sqlite3/
base.py", line 167, in execute
return Database.Cursor.execute(self, query, params)
OperationalError: user-defined function raised exception
If I apply patch #3501, that error goes away and I get the expected
list of objects. Is there a way I can verify that this isn't just some
problem on my end?
Jerry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---