Monday, December 22, 2014

Re: Model form with optional fields issue


> What do you think - is this expected?

Yes, this is expected. Django's form system is designed for use with
HTML forms, which do not provide partial data: unchanged field values
are sent too, so this problem does not occur.

I thought that Web framework can validate RESTful(-like) requests (like PATCH or even GET), but I see that without redesigning/overriding built-in forms it is not possible.. :(

I would like to say that in my opinion validation and cleaning (forms essentials) should be decoupled from HTML input and rendering. 
Without that, forms are only partially usable. It's a design issue, IMO.

Nowdays I'm creating more apps with separated clients written in pure js, and I need solid backend. 
Input cleaning, validation and processing logic is the most important thing.
But with validation designed mostly for plain-old-html input I can't rely on Django as a web framework.
That's sad, because I like it for rapid development. 

Kind Regards,
/Marcin

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d15de090-649f-4e95-9262-f2f22462598f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment