Answer the question
In order to leave comments, you need to log in
How to pass dynamic fields to save()?
There are 4 fields that are not in the database and not in the model, I need them when a certain status is selected.
That is, the required fields when choosing a status.
forms.py
delivery= forms.CharField(required = False, label = u"Доставка", widget=forms.TextInput(attrs={'size':40}))
model.py
def save()
как сюда вывести request.POST
???
Answer the question
In order to leave comments, you need to log in
Offhand - your form has a save method. This is where you accept your fields in cleaned_data, and pass the required field to the save() method of the model.
This is better than trying to push request directly into the model.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question