'Helper to look up a model from a <object model=...> or a <field
rel=... to=...> node.'

def _get_model_from_node(self, node, attr):

    model_identifier = node.getAttribute(attr)
    if (not model_identifier):
        raise base.DeserializationError((u"<%s>    node    is    missing    the    required    '%s'    attribute" % (node.nodeName, attr)))
    try:
        Model = models.get_model(*model_identifier.split(u'.'))
    except TypeError:
        Model = None
    if (Model is None):
        raise base.DeserializationError((u"<%s>    node    has    invalid    model    identifier:    '%s'" % (node.nodeName, model_identifier)))
    return Model
