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 and Brandon Bell committed Apr 7, 2021
1 parent 07a5e44 commit 8ced5d4
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 @@ -160,7 +160,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 8ced5d4

Please sign in to comment.