I am a bit confused. I know that by using Formset we could generate multiple form. Aside from that , when should I use Formset or Modelform?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ModelForms are used to automatically create forms based on a single model instance.
If you don’t have a model instance (and don’t want to create one), but just want to handle arbitrary data, use a plain old form.
If you have lists of data that you need to get, whether as Models or data, FormSets are the answer.
FormSets are used to automatically manage lists of forms. You don’t want to handle each form separately unless you need to. A FormSet can also use ModelForms, Yeah!