11👍
✅
There is a django snippet which does just this: multiple choice model field. It says:
Usually you want to store multiple
choices as a manytomany link to
another table. Sometimes however it is
useful to store them in the model
itself. This field implements a model
field and an accompanying formfield to
store multiple choices as a
comma-separated list of values, using
the normal CHOICES attribute.
4👍
Django-multiselectfield does what you require:
https://github.com/goinnn/django-multiselectfield
It’s inspired by the snippet that Alexander mentioned.
- Django DateTimeField says 'You are 5.5 hours ahead of server time.'
- Display user group in admin interface?
- How to send django objects to celery tasks?
0👍
This django snippet accomplishes the same with a much smaller footprint.
http://djangosnippets.org/snippets/23/
make sure to update those imports since they are pre version 1.0
Source:stackexchange.com