Monday, October 29, 2012

Easy way to make all form fields read only?

Semi-new to Django and working on my first "real" app, and I have a need based on the user's credentials to display forms as either editable or read-only. (Note this doesn't have anything to do with the Django admin in case that has any bearing on the discussion.)

Is there some fancy whiz-bang filter or middleware-type doo-dad (you can tell I'm still learning all the terminology) that would easily make all form fields read only?

I thought about using javascript (this is an internal app so we can mandate javascript be enabled) but before I went that route figured I'd ask if anyone has had to do this and how they approached it.

Personally I think it's weird to show someone a form they can't edit as opposed to just dumping them to a static display page, but wasn't my call.

Thanks!

--
Matthew Woodward
matt@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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