#10220: the admin site can not handle the DateField.
---------------------------+------------------------------------------------
 Reporter:  duns           |       Owner:  nobody    
   Status:  new            |   Milestone:  post-1.0  
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 {{{
 class WInfo(models.Model):
     city = models.CharField(max_length=1, default='A')
     w_date = models.DateField()

     def __unicode__(self):
         return str(self.id)
 }}}

 In the admin site, I fail to add a record. After I modify
 SplitDateTimeWidget.decompress, it's OK.

 "C:\Python25\lib\site-packages\django\forms\widgets.py"

 {{{
 class SplitDateTimeWidget(MultiWidget):
     ...
     def decompress(self, value):
         if value:
             #return [value.date(), value.time().replace(microsecond=0)]
             if type(value) == 'datetime':
                 return [value.day(), value.time().replace(microsecond=0)]
             if type(value) == 'date':
                 return [value, None]
         return [None, None]
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10220>
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 [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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to