Closed Amr-Hash closed 3 years ago
I have a model which has a user defined primary key so I assigned include_primary_keys to True
Model
class Model(db.Model): pk_col = db.Column(db.String(100), primary_key=True) some_other_col = db.Column(db.String(100))
Form
class CreateModelForm(ModelForm): class Meta: model = Model include_primary_keys = True
but when I send a request with pk_col to it it responded with
The calling ModelForm(data={'pk_col':'some_value'})
ModelForm(data={'pk_col':'some_value'})
response
{ "errors": { "pk_col": [ "This field is required." ] } }
Sorry it's my fault I was passing the request post to the form using Form(data=data) but it needed to be passed as From(data) with data being MultiDict
I have a model which has a user defined primary key so I assigned include_primary_keys to True
Model
Form
but when I send a request with pk_col to it it responded with
The calling
ModelForm(data={'pk_col':'some_value'})
response