'Checks the record for the subfields allowing referencing (an
existing record in an other table), errors out if it finds potential
conflicts (multiple referencing subfields) or non-referencing subfields
returns the name of the correct subfield.
:param record:
:return: the record subfield to use for referencing and a list of warnings
:rtype: str, list'

def _referencing_subfield(self, record):

    fieldset = set(record.iterkeys())
    if (fieldset - REFERENCING_FIELDS):
        raise ValueError(_(u'Can    not    create    Many-To-One    records    indirectly,    import    the    field    separately'))
    if (len(fieldset) > 1):
        raise ValueError(_(u"Ambiguous    specification    for    field    '%(field)s',    only    provide    one    of    name,    external    id    or    database    id"))
    [subfield] = fieldset
    return (subfield, [])
