I’m a django novice, coming from the php world. I couldn’t figure how to use django to create certain input fields that I need for a project. So I manually added the html for those fields, into the template. I.e., I added checkboxes and menus. In view.py, I then added code to obtain the user’s selections of the checkboxes and menus, via request.POST. Using those selections, I can then modify and save the form’s instance.
All works well. The only glitch is if the form doesn’t validate. If that happens, I need to redisplay the form, with error messages displayed at the top. So I call render to redisplay the form. The redisplayed form, loses all the selections of my customized html. I.e., the customized checkboxes and menus get reset, but not the django created input fields. Is there a way to save the user’s selections for the customized html? Thanks.
models.py
forms.py
views.py
add_debt.html