On Tue, 2009-02-17 at 20:25 -0500, Alex Gaynor wrote:
[...]

> Writing a custom widget to do it isn't especially easy because the
> render method on widgets doesn't get the initial value, however you
> can do it:
> http://lazypython.blogspot.com/2008/12/building-read-only-field-in-django.html

Yeah, I should have said custom form field, not custom widget, since you
have to approach it from that level (it will involve a custom widget as
well, but that kind of follows naturally when you develop it). Rendering
the read-only things as plain text, as you've done, is the right
approach.

Your approach, despite your misgivings in the post, doesn't appear too
bad on the surface. In the final solution, we can probably remove the
need for a widget at all for that type of field (i.e. a
no-widget-required field that knows how to display static text of some
nature).

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to