Re: Display Certain Fields of the Model Formset As Text

2009-11-02 Thread David De La Harpe Golden
Preston Holmes wrote: > When using widget.attr how does one specify a attr that is name only, > not key/value. > > The disabled key is not a k/v attr: > > > In xhtml 1 (fwiw) it is, you are required to write disabled="disabled" (I think) and it is also allowed to do so in html 4 See section

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Anthony Simonelli
On Fri, Oct 30, 2009 at 2:58 PM, Anthony Simonelli wrote: > On Fri, Oct 30, 2009 at 10:58 AM, Tom Evans wrote: >> When you iterate through the fieldset, you should be iterating through form >> instances. Because they are forms from a ModelFormSet, they will be >> ModelForm instances, and so will

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Bill Freeman
On Fri, Oct 30, 2009 at 4:36 PM, Preston Holmes wrote: > > > > On Oct 30, 12:00 pm, Bill Freeman wrote: >> Yet another option is to write a widget that subclasses the existing >> one, and adds >> disabled='disabled' to the dictionary that will be used to populate >> the attributes >> (usually th

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Preston Holmes
On Oct 30, 12:00 pm, Bill Freeman wrote: > Yet another option is to write a widget that subclasses the existing > one, and adds > disabled='disabled' to the dictionary that will be used to populate > the attributes > (usually the 'attrs' argument, I think, and you will have to handle > the poss

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Anthony Simonelli
On Fri, Oct 30, 2009 at 10:58 AM, Tom Evans wrote: > When you iterate through the fieldset, you should be iterating through form > instances. Because they are forms from a ModelFormSet, they will be > ModelForm instances, and so will have an instance attribute that you can use > to output the fie

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Bill Freeman
Yet another option is to write a widget that subclasses the existing one, and adds disabled='disabled' to the dictionary that will be used to populate the attributes (usually the 'attrs' argument, I think, and you will have to handle the possibility that you will be passed None instead of a dict).

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Tom Evans
When you iterate through the fieldset, you should be iterating through form instances. Because they are forms from a ModelFormSet, they will be ModelForm instances, and so will have an instance attribute that you can use to output the fields you don't want in the form. You can then restrict the fie

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread pjrhar...@gmail.com
On Oct 30, 5:47 am, Anthony Simonelli wrote: > Is there any way to display the fields as text rather than as input fields? My suggestion would be to write your own widget that simply renders as text, and make all the uneditable fields use that widget. Have a look in the django code (django/form

Display Certain Fields of the Model Formset As Text

2009-10-29 Thread Anthony Simonelli
Hello, I am using a Model Formset because there are two foreign keys in my Model and it makes it easy to create forms with them preselected from data in my model: class ForecastActualSum(models.Model): sales_rep = models.ForeignKey(SalesrepGrpname) customer = models.ForeignKey(Customer)