Sunday, July 29, 2012

Form validation using model data?

I have a model for Websites that has 3 fields: name, url and authenticated. With a form both the name and url can be changed, but when the website is authenticated i don't want to allow that the url changes.

I'm thinking about making the url (form) field readonly but in html the field becomes still an input field (just with readonly="True"), so i have doubts whether hackers will be able to post a changed value anyhow (i'll need to test this).

Another approach is to add some custom form validation against the (current) model, but i have doubts whether validation is the solution for this?

Thanks for any directions
Paul

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/urE06kkuNBIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment