#2611: XML serialization does not handle null datetime fields
--------------------------------+-------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Database wrapper | Version: SVN
Severity: normal | Resolution:
Keywords: |
--------------------------------+-------------------------------------------
Old description:
> If you try to serialize a Django object to XML (JSON serialization is
> fine) that has a null datetime field, you get the following error:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "c:\python24\lib\site-
> packages\django\core\serializers\__init__.py", line
> 55, in serialize
> s.serialize(queryset, **options)
> File "c:\python24\lib\site-packages\django\core\serializers\base.py",
> line 39,
> in serialize
> self.handle_field(obj, field)
> File "c:\python24\lib\site-
> packages\django\core\serializers\xml_serializer.py"
> , line 61, in handle_field
> value = self.get_string_value(obj, field)
> File "c:\python24\lib\site-packages\django\core\serializers\base.py",
> line 53,
> in get_string_value
> value = getattr(obj, field.name).strftime("%Y-%m-%d %H:%M:%S")
New description:
If you try to serialize a Django object to XML (JSON serialization is
fine) that has a null datetime field, you get the following error:
{{{
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "c:\python24\lib\site-
packages\django\core\serializers\__init__.py", line
55, in serialize
s.serialize(queryset, **options)
File "c:\python24\lib\site-packages\django\core\serializers\base.py",
line 39,
in serialize
self.handle_field(obj, field)
File "c:\python24\lib\site-
packages\django\core\serializers\xml_serializer.py"
, line 61, in handle_field
value = self.get_string_value(obj, field)
File "c:\python24\lib\site-packages\django\core\serializers\base.py",
line 53,
in get_string_value
value = getattr(obj, field.name).strftime("%Y-%m-%d %H:%M:%S")
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/2611>
Django <http://code.djangoproject.org/>
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
-~----------~----~----~----~------~----~------~--~---