#16421: Serializing TimeField throws Attribute Error
--------------------------+----------------------------------------------
 Reporter:  silent1mezzo  |          Owner:  nobody
     Type:  Bug           |         Status:  new
Milestone:                |      Component:  Database layer (models, ORM)
  Version:  1.3           |       Severity:  Normal
 Keywords:                |   Triage Stage:  Unreviewed
Has patch:  1             |  Easy pickings:  0
    UI/UX:  0             |
--------------------------+----------------------------------------------
 Affects version 1.2.x, 1.3

 Model:
 {{{
 class TestModel(models.Model):
     test_time = models.TimeField()
 }}}

 Stack Trace
 {{{
 File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/core/serializers/__init__.py", line 87, in serialize
     s.serialize(queryset, **options)
   File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/core/serializers/base.py", line 45, in serialize
     self.handle_field(obj, field)
   File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/core/serializers/python.py", line 45, in handle_field
     self._current[field.name] = field.value_to_string(obj)
   File "/home/webdev/web/virtualenvs/polaris/lib/python2.6/site-
 packages/django/db/models/fields/__init__.py", line 1103, in
 value_to_string
     data = val.strftime("%H:%M:%S")
 AttributeError: 'unicode' object has no attribute 'strftime'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16421>
Django <https://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-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to