Closed voronind closed 8 years ago
That's not true
It's good with widget=forms.CheckboxSelectMultiple
, but no changes without widget specification.
Have you missed to include jquery before includes/material_js.html
?
No. I use Python 3
I tried your example code and got the same.
My code render result of {% form %}{% ednform %}
:
<div class="row">
<div id="id_languages_container" class="select-field col s12 required multiselect">
<label for="id_languages" class="">Язык</label> <select class="material-ignore" name="languages" id="id_languages" multiple="">
<option value="**">Не зависит </option>
<option value="EN">Английский </option>
<option value="RU">Русский </option>
<option value="DE">Немецкий </option>
</select>
</div>
</div>
<div class="row">
<div id="id_languages_container" class="select-field col s12 required multiselect">
<label for="id_languages" class="">Язык</label> <select class="material-ignore" name="languages" id="id_languages" multiple="">
<option value="**">Не зависит </option>
<option value="EN">Английский </option>
<option value="RU">Русский </option>
<option value="DE">Немецкий </option>
</select>
</div>
</div>
You should check javascript errors in the browser console
class="material-ignore" lol, are you about admin part? This is not `MultipleChoiceField
No. It's my FormView with your example form or my form. Result is the same.
Default multiple select widget if field = forms.MultipleChoiceField(..., widget=forms.SelectMultiple)
2016-02-19 13:54 GMT+03:00 Mikhail Podgurskiy notifications@github.com:
* class="material-ignore"* lol, are you about admin part? This is not MultipleChoiceField
— Reply to this email directly or view it on GitHub https://github.com/viewflow/django-material/issues/80#issuecomment-186170196 .
I have no idea, what's wrong with you code.
You copy-pasted the html that could be rendered only from django_filteredselectmultiple.html
That's the admin part.
I don't include material.admin
to INSTALLED_APPS even.
templates/material/fields/django_selectmultiple.html
content:
{% load material_form material_form_internal %}
{% render bound_field template='fields/django_select.html' %}
{% part field add_control_attr %}multiple{% endpart %}
{% part field add_group_class %}multiselect{% endpart %}
{% part field add_control_class %}material-ignore{% endpart %}
{% part field options %}
{% for value, choice in field.widget.choices %}
<option {% if value in bound_field.value %}selected="selected"{% endif %}
{% if value == None or value == '' %}style="display:none"{% endif %}
value="{{ value|default_if_none:"" }}" >{% if value == None or value == '' %}{{ form_select_empty_label|default:choice }}{% else %}{{ choice }}{% endif %} </option>
{% endfor %}
{% endpart %}
{% endrender %}
I use last release 0.5.1
2016-02-19 15:02 GMT+03:00 Mikhail Podgurskiy notifications@github.com:
That's not true - https://github.com/viewflow/django-material/blob/master/material/templates/material/fields/django_selectmultiple.html
— Reply to this email directly or view it on GitHub https://github.com/viewflow/django-material/issues/80#issuecomment-186189087 .
You should use git version, before posting issue requests
I tried. Master is broken.
Invalid filter: 'select_options'
In template /home/dima/.virtualenvs/mathtrade/lib/python3.4/site-packages/material/templates/material/fields/django_select.html, error at line 18
How did you get the error? Did you grab the whole code or just html template?
It's DEBUG=True
output.
I installed master version.
2016-02-19 15:17 GMT+03:00 Mikhail Podgurskiy notifications@github.com:
And how did you get the error? Did you grab the whole code or just html template?
— Reply to this email directly or view it on GitHub https://github.com/viewflow/django-material/issues/80#issuecomment-186194079 .
I have no such error.
It's OK now
2016-02-19 15:24 GMT+03:00 Mikhail Podgurskiy notifications@github.com:
I have no such error.
— Reply to this email directly or view it on GitHub https://github.com/viewflow/django-material/issues/80#issuecomment-186196731 .
forms.MultipleChoiceField
has no materialized implementation. It's standard widget. Django 1.9.2 django-material 0.5.1