Update README.rst
This commit is contained in:
parent
8076347a5a
commit
346b8e3f41
1 changed files with 5 additions and 2 deletions
|
@ -83,15 +83,18 @@ Only you need it, if you want the translation of django-multiselectfield
|
|||
Django REST Framework
|
||||
---------------------
|
||||
|
||||
Django REST Framework comes with a ``MultiSelectField`` that works perfectly with this:
|
||||
Django REST Framework comes with a ``MultipleChoiceField`` that works perfectly with this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from rest_framework import fields, serializers
|
||||
|
||||
from myapp.models import MY_CHOICES, MY_CHOICES2
|
||||
|
||||
class MyModelSerializer(serializers.HyperlinkedModelSerializer):
|
||||
# ...
|
||||
fields.MultiSelectField()
|
||||
my_field = fields.MultipleChoiceField(choices=MY_CHOICES)
|
||||
my_field2 = fields.MultipleChoiceField(choices=MY_CHOICES2)
|
||||
# ...
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue