On Oct 30, 12:00 pm, Bill Freeman <ke1g...@gmail.com> 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 possibility
> that you will be passed None instead of a dict).
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:
<INPUT disabled name="fred" value="stone">
-Preston
>
> Bill
>
> On Fri, Oct 30, 2009 at 1:47 AM, Anthony Simonelli
>
>
>
> <asimonell...@gmail.com> wrote:
>
> > 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)
> > item = models.CharField(max_length=200)
> > actual = models.FloatField(null=True, blank=True)
> > forecast = models.FloatField(null=True, blank=True)
> > plan = models.FloatField(null=True, blank=True)
>
> > When using a model formset, all the fields are displayed and are editable,
> > but I just want the 'forecast' field to be editable and the rest of the
> > fields to be displayed. Is there any way to display the fields as text
> > rather than as input fields? I've also tried sending the corresponding
> > ForecastActualSum objects along with the formset to the template to be
> > displayed along side formset, but I can't iterate both at the same time to
> > make them line up like a table. Anyone have any ideas? Maybe model
> > formset is not the way to go?
>
> > Anthony
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---