Hello all, I have a custom form class that's called from a separate view file. That form class has an init method, and it works perfectly when I don't have to pass any parameters to that method. However, when I pass in ANY parameter (so it's not a namespace issue) the form simply won't submit. It'll load perfectly, but when I push 'submit', it just reloads a new version of itself. Do I need to change any of the code in the view method (other than obviously passing the parameter in to the form) to reflect the parameter change? Here's the form class's code:
[code] 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)'})) [/code] Any ideas? Thanks so much! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---