#11984: Problem with date_hierarchy in Django 1.1 - Truncated incorrect datetime
value: '0000-01-01 00:00:00'
-------------------------------------------------+--------------------------
          Reporter:  sergey.g.ales...@gmail.com  |         Owner:     
            Status:  new                         |     Milestone:     
         Component:  django.contrib.admin        |       Version:  1.1
        Resolution:                              |      Keywords:     
             Stage:  Unreviewed                  |     Has_patch:  0  
        Needs_docs:  0                           |   Needs_tests:  0  
Needs_better_patch:  0                           |  
-------------------------------------------------+--------------------------
Comment (by sorin):

 I this error is also part of the same bug - shortly django should be able
 to work with invalid dates from database.

 {{{
 Caught an exception while rendering: invalid literal for int(): None
 }}}

 {{{
 Original Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/django/template/debug.py", line
 71, in render_node
     result = node.render(context)
   File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
 line 936, in render
     dict = func(*args)
   File "/usr/lib/python2.4/site-
 packages/django/contrib/admin/templatetags/admin_list.py", line 308, in
 date_hierarchy
     return {
   File "/usr/lib/python2.4/site-packages/django/db/models/query.py", line
 106, in _result_iter
     self._fill_cache()
   File "/usr/lib/python2.4/site-packages/django/db/models/query.py", line
 692, in _fill_cache
     self._result_cache.append(self._iter.next())
   File "/usr/lib/python2.4/site-
 packages/django/db/models/sql/subqueries.py", line 397, in results_iter
     date = typecast_timestamp(str(date))
   File "/usr/lib/python2.4/site-packages/django/db/backends/util.py", line
 68, in typecast_timestamp
     if not ' ' in s: return typecast_date(s)
   File "/usr/lib/python2.4/site-packages/django/db/backends/util.py", line
 53, in typecast_date
     return s and datetime.date(*map(int, s.split('-'))) or None # returns
 None if s is null
 ValueError: invalid literal for int(): None
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11984#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=.


Reply via email to