Re: [Django] Error occured while saving a form created through model formset factory

2020-02-15 Thread Integr@te System
Hi, Plz check about: HttpResponseRedirect('/gspapp/ModelGSPRequestList') On Sat, Feb 15, 2020, 13:15 Dilipkumar Noone wrote: > Hi Maninder, > > This error seems because i used choice field which actually use names as > values but django expects the id. > > As Django automatically creates a

Re: [Django] Error occured while saving a form created through model formset factory

2020-02-14 Thread Dilipkumar Noone
Hi Maninder, This error seems because i used choice field which actually use names as values but django expects the id. As Django automatically creates a ModelChoicefield for a Foreign Key which use the correct values,i modified the code as below in forms.py. I have a requirement to populate

[Django] Error occured while saving a form created through model formset factory

2020-02-09 Thread Dilipkumar Noone
I am a Django learner. 1.I have a requirement to create the multiple forms in a single page for a model. 2.So i created the formset using modelformset_factory. 3.I have 2 models. a)ModelRegister b)ModelGSPRequest. 4.ModelGSPRequest has a field named registered_model which is a foreignKey to

Model Formset Factory

2008-11-16 Thread Stu
When using a modelform on its own, I see that overriding __init__() enables the customization of generated forms. Is it possible to customize each of the modelforms (say changing the widgets on some of the form fields, adding/removing a field, etc.) in a modelformset when using