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
fields that the formset will consider[1]

Cheers

Tom

[1]
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#controlling-which-fields-are-used-with-fields-and-exclude

On Fri, Oct 30, 2009 at 5: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
-~----------~----~----~----~------~----~------~--~---

Reply via email to