'Returns all the model fields that are being mapped to by fields
on the serializer class.
Returned as a dict of \'model field name\' -> \'model field\'.
Used internally by `get_uniqueness_field_options`.'

def _get_model_fields(self, field_names, declared_fields, extra_kwargs):

    model = getattr(self.Meta, u'model')
    model_fields = {}
    for field_name in field_names:
        if (field_name in declared_fields):
            field = declared_fields[field_name]
            source = (field.source or field_name)
        else:
            try:
                source = extra_kwargs[field_name][u'source']
            except KeyError:
                source = field_name
        if ((u'.' in source) or (source == u'*')):
            continue
        try:
            field = model._meta.get_field(source)
            if isinstance(field, DjangoModelField):
                model_fields[source] = field
        except FieldDoesNotExist:
            pass
    return model_fields
