Django users,

I'm wrestling with how to best create HTML pages that can either be
used for displaying or editing data. That is, I'd like the field's
values to appear as text in display mode, but in their widgets when in
edit/add mode. It appears that Django wasn't designed to do this: the
fields always appear in their widgets (eg, text input, text area,
etc).

Is there a common technique for handling this, short of using forms
for one, and not the other?

I was thinking of a custom templatetag filter that could be used for
every form field, like:

{{ form.field_name|render_field:mode }}

where render_field would either return the field's HTML widget, or
just the value as text, based on the mode.

Have I missed something, or is this a viable solution?

-Doug

--

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


Reply via email to