lundi 23 mars 2015

Proper way to handle PUT requests Django with forms

I have a web app that allows users to edit previously submitted data.


I'm currently processing PUT requests by manually updating the data.


I would like to use my forms to validate input but I run into the issue of the other required fields.


For instance, if a user updates a date field and I validate it with my form, it errors out as I'm missing other required fields like name, location, etc since the form was designed to be filled out all at once.


What is the best way to use my forms to validate input but conditionally allow required fields if the request is a PUT or POST with model Forms.


Aucun commentaire:

Enregistrer un commentaire