Let's start by agreeing on common terminology. "property" has a meaning in Python slightly different than its usage in some other languages, and I don't think that's what you mean.
I'm thinking that what you mean by "property" on the form is what Python calls an attribute of the instance of the form class. So, below, you got the item "form" by doings something like form = MyModelFormClass(instance=some_model_instance, ...) and that you are passing it as part of the context (possibly indirectly, but we can worry about details later) in a template rendering operation, someting like: return render_to_response("some/template.html", {'beef_form': form, ...}) And you want to include, somewhere between the statements above: form.product_description = u'Some string involving "hanging weight"' Am I tracking so far? If so, in your template, you should, at the appropriate point, be able to say: <TD>{{ beef_form.product_description }}</TD> That should do what you would think. The product_description attribute is not used automatically by anything, but is available for the variable reference in the template. So, is this what you want, and if so have you tried it, and if so what don't you like about the result? Bill On Thu, Sep 2, 2010 at 3:06 PM, bobhaugen <bob.hau...@gmail.com> wrote: > Bill, > > Thanks a lot for sticking with this question. > > On Sep 2, 1:44 pm, Bill Freeman <ke1g...@gmail.com> wrote: >> I guess that what I'm saying is that when you get fussy about rendering, you >> need to write the html/css yourself. Because you say you want read only for >> these fields, don't use the form field's rendering at all (or use a >> hidden field). > > I don't want a field, I want an additional property on each form in > the formset, that I can set differently for each form. I can do this > easily if I roll my own set-of-forms (not a formset) where I add to > each form something like form.product_description = "Beef, Whole, > choice or better, per pound hot hanging weight". > > I swear, that is an actual product description. But so is > "Strawberries, pint". So if I use a product_description field, and > put it in a table cell, I need to size the field to handle the Beef, > Whole etc. and the table gets too wide for the window. If I use a > non-field property, HTML wraps the cell nicely as needed. > >> Or I may be totally misunderstanding the original problem. > > I don't know, probably I am not communicating well, or maybe I am > missing something in your suggestions. I did read through all of the > Django documentation on forms, formsets, form api, fields, etc., and > did not find anything that I could see helping. > > And this forum thread appears to say that I cannot display the value > of the field in a template: > http://groups.google.com/group/django-users/browse_thread/thread/cb62abb7eeab54c4/ > > Thus the simplest thing I can think of is to add a non-field property > to each form, but I don't know how to do that with forms in a formset. > > I suppose I could use a hidden field and extract and present the value > using javascript. > > Or maybe I could create a custom widget that rendered its value as a > string, not an HTML input. > > And if I can't find a way to add a simple non-field property to forms > in a formset, I will probably try the custom widget next. > > Anyway, I do appreciate your followup reply. > > -Bob > > -- > 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. > > -- 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.