C
C
Cyber_bober2016-04-13 12:39:55
Django
Cyber_bober, 2016-04-13 12:39:55

Why are m2m not sent from the form?

Hello, for some reason the multiple choice fields from the form are not sent, what should I do?
Form Output

<form method="POST" class="post-form" enctype="multipart/form-data">{% csrf_token %}
            {{ form|bootstrap}}
            <button type="submit" class="save send">Сохранить</button>
        </form>

forms.py
class FarmEditFood(forms.ModelForm):
    class Meta:
      model = Ranch
      fields = ('foods','category','ranchmode','typeprod','ranchmode', 'delivery','delivery2' )

Ordinary textFields are saved, but these are not, what could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Maltsev, 2016-04-13
@hellpirat

<form action="{% url 'edit_view' %}">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question