'A dict mapping column names to model field names.'

@property
def model_fields(self):

    if (not hasattr(self, '_model_fields')):
        converter = connections[self.db].introspection.table_name_converter
        self._model_fields = {}
        for field in self.model._meta.fields:
            (name, column) = field.get_attname_column()
            self._model_fields[converter(column)] = field
    return self._model_fields
