MultipleCharField

111 views
Skip to first unread message

Rafael Macêdo

unread,
Mar 4, 2016, 3:38:05 PM3/4/16
to Django users
Sou iniciante em Django e gostaria de saber se há algum tipo de campo na classe Model semelhante ao MultipleChoiceField da classe Form.

Obrigado desde já.

Bernardo Garcia

unread,
Mar 8, 2016, 10:11:53 AM3/8/16
to Django users
Hi RAfael.

I am using this app for multi select fields https://github.com/goinnn/django-multiselectfield
which perform a render the options like checkbox of multiple selection in the django admin forms

You should install it of this way

2. Inside of your virtual environment execute pip install <name-of-file-tar.gz>
3. Specify 'multiselectfield' in the INSTALLED_APPS in settings.py


When you run the Django Server, if you are using Django 1.9.2 you see this warning 

site-packages/multiselectfield/db/fields.py:45: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  return metaclass(cls.__name__, cls.__bases__, orig_vars)

THis warning is related with this, but I unknown how to fix for the context of multiselectfield package application.


Another alternatives for multiselects fields are:
https://github.com/digi604/django-smart-selects which I am also using it! this works models based in ManyToMany relationships.

I hope that these resource are useful for you.

Best Regards.
Reply all
Reply to author
Forward
0 new messages