Some trouble using ajax in with forms.
To make things simple a dumb down version
I got a two fields :

class MyForm(forms.Form):
     room =
forms.ModelChoiceField(queryset=Product.objects.filter(type=1))
     attending = forms.ChoiceField(required=False, choices=(('',
'---------'),))

However each room has a max number of people. When a user selects room
A or B ... the max number of attending will be diffrent for each room.

So with jquery I adjust this part. But the newforms does not know
this. Al it cares is to validate on the offset tuple (('', '-----'),)

The Question:
--------------------

How can I make newforms a bit smarter.
It should give the tuple based on a range(x,z) function other
choices.
So when a post is submited then first it should look up what the max
people are for a room. This should be passed to the attending field.
Also when a form is shown for an update Newforms should first look at
how many people there are allowed in the room and change the tuple for
that.
I'm not sure how to do this in the correct way?
--~--~---------~--~----~------------~-------~--~----~
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