You could use inline formsets (have CustomerContactAnswer be a formset of
CustomerContactQuestion) and then render the Answer forms as a table in the
template.

- Paulo

On Mon, Mar 22, 2010 at 1:31 PM, ALJ <[email protected]> wrote:

> Is there any to have a table type form will variable rows and columns?
>
> I have events. For each event there might be several appointment days.
> And a set of questions to measure how many people the rep had contact
> with.
>
> My expected form output would be something like:
>
> Question,                                              Day1, Day2,
> Day3
> How many people did you see?               20,     30,     40
> How many bought stuff?                         2,       1,       4
> How many samples did you give away?   15,     17,     20
>
> ... which they could fill in and submit.
>
> Has anyone else done anything like this?
>
> (Again, I think I might have bitten off more than I can chew here!)
>
> ALJ
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>..
> models.py
>
> class Appointment(models.Model):
>    event = models.ForeignKey(Event)
>    date = models.DateField("Date")
>    time_start = models.TimeField("Start Time")
>    time_end = models.TimeField("End Time")
>
>    class Meta:
>        ordering = ['date','time_start']
>
> class CustomerContactQuestion(models.Model):
>    description = models.CharField("Question",max_length=200)
>    order = models.IntegerField("Presentation Order", null=True,
> blank=True)
>
>    class Meta:
>        ordering = ['order','description']
>
> class CustomerContactAnswer(models.Model):
>    event= models.ForeignKey(Event)
>    customer_contact_question =
> models.ForeignKey(CustomerContactQuestion)
>    appointment = models.ForeignKey(Appointment)
>    amount = models.IntegerField()
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to