Skip to content

Commit

Permalink
fix: aliases pointing to foreign keys
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Nov 23, 2018
1 parent 3f7e3ab commit ea29c1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_find/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def get_caption_from_selector(cls, selector):

@classmethod
def get_field_type_from_field(cls, field):
if isinstance(field, models.ForeignKey):
field = field.target_field
for field_model, typename in type_map:
if isinstance(field, field_model):
return typename
Expand Down

0 comments on commit ea29c1b

Please sign in to comment.