'Test whether ``item`` (record or field name) is an element of ``self``.
In the first case, the test is fully equivalent to::
any(item == record for record in self)'

def __contains__(self, item):

    if (isinstance(item, BaseModel) and (self._name == item._name)):
        return ((len(item) == 1) and (item.id in self._ids))
    elif isinstance(item, basestring):
        return (item in self._fields)
    else:
        raise TypeError(('Mixing    apples    and    oranges:    %s    in    %s' % (item, self)))
