Re: Modeform Foreign key column not working

2021-10-26 Thread Aruna Priya Nagarajan
Hi, I am trying to save the model form and getting error that foreign key column is not there. *Error:* column "connection_type_id" of relation "connection_details_test" does not exist ( There is no column connection_type_id, why its looking for this column, should I change my model?) *Model

Re: Modeform Foreign key column not working

2021-10-23 Thread Lalit Suthar
cool! mention not :) On Thu, 21 Oct 2021 at 19:57, Aruna Priya Nagarajan < arunapriya.nagara...@gmail.com> wrote: > > yeah, it is a foreign key and I have put integer field instead of foreign > key in the model. I changed it now and its working by itself without > specifying ModelChoiceField. > >

Re: Modeform Foreign key column not working

2021-10-21 Thread Aruna Priya Nagarajan
yeah, it is a foreign key and I have put integer field instead of foreign key in the model. I changed it now and its working by itself without specifying ModelChoiceField. Thanks for your help!! On Wednesday, 20 October 2021 at 16:07:04 UTC+1 sutharl...@gmail.com wrote: > is `ConnectionTyp

Re: Modeform Foreign key column not working

2021-10-20 Thread lalit suthar
is `ConnectionTypes` a foreign key to `ConnectionDetails`? in that case you don't need to put it as a field in form, it will be added automatically in the form. On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote: > Hi, > > I am trying to create a form from model and the model h

Modeform Foreign key column not working

2021-10-20 Thread Aruna Priya
Hi, I am trying to create a form from model and the model has a foreign key and am not able to populate the values from the column it refers to. My form, class ConnectionForm(forms.ModelForm): connection_type = forms.ModelChoiceField(queryset=ConnectionTypes.objects.all(), to_field_name='con