Sure, my form class is as follows:
from django import newforms as forms
from quizmodo.core.models import Class, Event
from django.contrib.auth.models import User
class ClassEventForm(forms.Form):
c = forms.ModelChoiceField(queryset=Class.objects.all(),
label='Class',
widget=forms.Select(attrs={'onchange':'classSelectionChanged(this.id)'}))
event = forms.ModelChoiceField(queryset=Event.objects.none(),
required=False)
def __init__(self, my_id, *args, **kwargs):
# call the standard init first
super(ClassEventForm, self).__init__(*args, **kwargs)
self.fields['c'] =
forms.ModelChoiceField(queryset=Class.objects.filter(users__id=my_id),
label='Class',
widget=forms.Select(attrs={'onchange':'classSelectionChanged(this.id)'}))
Again, I'm not getting any visible errors, that I know of, when I
submit the form
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---