Saturday, 15 August 2015

Is it possible for Django ModelForms to work with dynamically added fields? -


I distinguish additional fields based on the relationship between a specific example (eg. Such as 'type') and other models (such as 'product attributes'). Products have general properties like weight and price but in one book a page is counted and a computer has spectacles.

I want to be able to do this with a modelform so that I just form (), But I'm not sure what this would be the right approach to do or where to begin. First I thought it would be possible to override some methods, but then I looked around the models.py file and it seems Is it that I have to add a lot of code to different places in order to handle additional places, i.e. enough work or am I easy to disappear?

Without special information, I can say that you are right. If additional fields are not part of the model, then at least, you have to override the SaveMF () method of ModelForm.


No comments:

Post a Comment