Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions inspect_model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def update_fields(self):
self.many_fields = set()
opts = getattr(self.model, '_meta', None)
if opts:
for f in opts.get_all_field_names():
field, model, direct, m2m = opts.get_field_by_name(f)
for field in opts.get_fields():
model = field.model
direct = not field.auto_created or field.concrete
m2m = field.many_to_many
if not direct: # relation or many field from another model
name = field.get_accessor_name()
field = field.field
Expand Down