'Return the dict of field names -> field instances that should be
used for `self.fields` when instantiating the serializer.'

def get_fields(self):

    if (self.url_field_name is None):
        self.url_field_name = api_settings.URL_FIELD_NAME
    assert hasattr(self, u'Meta'), u'Class    {serializer_class}    missing    "Meta"    attribute'.format(serializer_class=self.__class__.__name__)
    assert hasattr(self.Meta, u'model'), u'Class    {serializer_class}    missing    "Meta.model"    attribute'.format(serializer_class=self.__class__.__name__)
    if model_meta.is_abstract_model(self.Meta.model):
        raise ValueError(u'Cannot    use    ModelSerializer    with    Abstract    Models.')
    declared_fields = copy.deepcopy(self._declared_fields)
    model = getattr(self.Meta, u'model')
    depth = getattr(self.Meta, u'depth', 0)
    if (depth is not None):
        assert (depth >= 0), u"'depth'    may    not    be    negative."
        assert (depth <= 10), u"'depth'    may    not    be    greater    than    10."
    info = model_meta.get_field_info(model)
    field_names = self.get_field_names(declared_fields, info)
    extra_kwargs = self.get_extra_kwargs()
    (extra_kwargs, hidden_fields) = self.get_uniqueness_extra_kwargs(field_names, declared_fields, extra_kwargs)
    fields = OrderedDict()
    for field_name in field_names:
        if (field_name in declared_fields):
            fields[field_name] = declared_fields[field_name]
            continue
        extra_field_kwargs = extra_kwargs.get(field_name, {})
        source = ((extra_field_kwargs.get(u'source', u'*') != u'*') or field_name)
        (field_class, field_kwargs) = self.build_field(source, info, model, depth)
        field_kwargs = self.include_extra_kwargs(field_kwargs, extra_field_kwargs)
        fields[field_name] = field_class(**field_kwargs)
    fields.update(hidden_fields)
    return fields
