Ticket #4558: xml_serializer.py.diff
File xml_serializer.py.diff, 1.0 KB (added by , 17 years ago) |
---|
-
core/serializers/xml_serializer.py
old new 164 164 elif field.rel and isinstance(field.rel, models.ManyToOneRel): 165 165 data[field.attname] = self._handle_fk_field_node(field_node, field) 166 166 else: 167 if len(field_node.childNodes) == 1 and field_node.childNodes[0].nodeName == 'None':167 if field_node.getElementsByTagName('None'): 168 168 value = None 169 169 else: 170 170 value = field.to_python(getInnerText(field_node).strip().encode(self.encoding)) … … 178 178 Handle a <field> node for a ForeignKey 179 179 """ 180 180 # Check if there is a child node named 'None', returning None if so. 181 if len(node.childNodes) == 1 and node.childNodes[0].nodeName == 'None':181 if node.getElementsByTagName('None'): 182 182 return None 183 183 else: 184 184 return field.rel.to._meta.pk.to_python(