On Wed, Apr 2, 2008 at 6:20 AM, Przemek Gawronski <
[EMAIL PROTECTED]> wrote:

>
> FORMS_COUNT=3
>
> forms=[ SearchForm( prefix="form%d" % ( i )) for i in range( FORMS_COUNT
> )]
>
> Hope that helps some.
>
> Przemek


Przemek,

Thanks for the tip.  However, this brings me to my next problem.  How do I
process those incoming forms in my view if I don't know ahead of time how
many forms there are?

Normally, you'd do something like this:

form = SearchForm(request.POST)

and then process like normal, grabbing form.cleaned_data['foo'] like normal.

What I was *hoping* to be able to do was something like this, using PHP as
an example

foreach ($_POST['team'] as $team) {
     $this->Game->findAll(array('name' => $team['name']);
}

In other words, have one variable represent all the 'team' fields in my
form, and then I want to be able to iterate through each one.

Is this something that's only in the PHP world?

-- 
Chris Hartjes

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to