Wednesday, September 1, 2010

how to add a non-field text property to forms in a formset

I often want to add properties to a formset that will fill a table
cell with flexibly wrapping, read-only descriptive text. For example,
the description of a product, where the enterable field is the
quantity ordered.

If I use a field, the widget gets a fixed width and the contents do
not wrap (unless I use a Textarea, which then gets a fixed number of
rows). The product descriptions can vary from one word to a military-
style extended riff on options.

Moreover, if I understand correctly, it is either not possible or
unwise to display the initial value of a field as a string.

So what I end up doing is rolling my own set of forms (that is, not
using a formset) where I can add extra text properties to each form at
will.

Any other better solutions to this problem?

Did I miss anything in the above description?

Thanks.

--
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