Skip to content

Commit

Permalink
Handle hierarchical choices in get_%s_display()
Browse files Browse the repository at this point in the history
Bring the contributed method in line with Django's CharField.get_FOO_display() to handle named groups/categories
  • Loading branch information
piranhaphish authored Feb 10, 2021
1 parent 9c43f19 commit 91ce7ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion multiselectfield/db/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def contribute_to_class(self, cls, name):
if self.choices:
def get_list(obj):
fieldname = name
choicedict = dict(self.choices)
choicedict = dict(self.flatchoices)
display = []
if getattr(obj, fieldname):
for value in getattr(obj, fieldname):
Expand Down

0 comments on commit 91ce7ef

Please sign in to comment.