'Convert an <object> node to a DeserializedObject.'

def _handle_object(self, node):

    Model = self._get_model_from_node(node, u'model')
    if node.hasAttribute(u'pk'):
        pk = node.getAttribute(u'pk')
    else:
        pk = None
    data = {Model._meta.pk.attname: Model._meta.pk.to_python(pk)}
    m2m_data = {}
    model_fields = Model._meta.get_all_field_names()
    for field_node in node.getElementsByTagName(u'field'):
        field_name = field_node.getAttribute(u'name')
        if (not field_name):
            raise base.DeserializationError(u"<field>    node    is    missing    the    'name'    attribute")
        if (self.ignore and (field_name not in model_fields)):
            continue
        field = Model._meta.get_field(field_name)
        if (field.rel and isinstance(field.rel, models.ManyToManyRel)):
            m2m_data[field.name] = self._handle_m2m_field_node(field_node, field)
        elif (field.rel and isinstance(field.rel, models.ManyToOneRel)):
            data[field.attname] = self._handle_fk_field_node(field_node, field)
        else:
            if field_node.getElementsByTagName(u'None'):
                value = None
            else:
                value = field.to_python(getInnerText(field_node).strip())
            data[field.name] = value
    return base.DeserializedObject(Model(**data), m2m_data)
