I am using modelformset_factory to create forms. When the forms are completed and submitted in the template patients_doses_form.html
I get " Dose formset is not valid" in line 1077 of the patient_doses_view in views.py and the following error is displaying in the terminal:
Dose formset errors: [{'dose_id': ['This field is required.']}, {'dose_id': ['This field is required.']}, {}]
Form errors: <ul class="errorlist"><li>dose_id<ul class="errorlist"><li>This field is required.</li></ul></li></ul>
Form errors: <ul class="errorlist"><li>dose_id<ul class="errorlist"><li>This field is required.</li></ul></li></ul> class
dose_id is the primary key of the model dose class at line 44 of models.py.
The DoseForm class and BaseDoseFormSet class are in line 286-322 of forms,py.
How do I fix this error? Thanks Marshall
The code is on github at https://github.com/marshallapierce/pkinecticdrugdosing
Contribute to marshallapierce/pkinecticdrugdosing development by creating an account on GitHub.