django-choices
django-choices copied to clipboard
Combine two list of choices
I have a model field as below:
suggestion = models.CharField(
_('suggestion'),
blank=True,
choices= **(choice1, choice2)**,
max_length=255,
)
I have two choice lists...let's say
class FeedbackComplimentType(DjangoChoices):
...
and
class FeedbackIssueType(DjangoChoices):
...
How do I combine the above two choices and use them with my model field's choices attribute? (choices: **(choice1, choice2)**
)?
Sorry for getting back to you so late, but this is not something provided out of the box.
I suppose you could do something like choices=list(FeedbackComplimentType.choices) + list(FeedbackIssueType.choices)