Re: newform: Why Doesn't This work

2007-10-17 Thread RajeshD
Aaargh...the indentation got screwed up. Here's another attempt: class myForm(forms.Form): def __init__(self, *args, **kwargs): self.q_prime = [] # default choices here? try: self.q_prime = kwargs.pop('q') except: pass super(myForm,

Re: newform: Why Doesn't This work

2007-10-17 Thread RajeshD
class myForm(forms.Form): def __init__(self, *args, **kwargs): try: self.q_prime = kwargs.pop('q') except: pass super(myForm, self).__init__(*args, **kwargs) choice = forms.ChoiceField(label="My choice",

Re: newform: Why Doesn't This work

2007-10-16 Thread Joseph Heck
The "choice = " is getting evaluated as a class, and the self.q_prime is referring to an instance of the class myForm. At least I think that's what's happening here... -joe On 10/16/07, johnny <[EMAIL PROTECTED]> wrote: > > Below is my form class. Inside myForm, I tried doing this: > > choice

newform: Why Doesn't This work

2007-10-16 Thread johnny
Below is my form class. Inside myForm, I tried doing this: choice = forms.ChoiceField(label="My choice", choices=myChoice(self.q_prime).choices()) I get an error right here "choices=myChoice(self.q_prime).choices()": name 'self' is not defined My Form Class: class