Re: Exclude fields in form by language

2008-11-14 Thread Brandon Taylor
I see. What I ended up doing was just subclassing the form for English and Spanish and putting the logic in the view. It's not quite as pretty as I'd like, but I'm out of time and need to get it going. I would love to see an example of how to manipulate a form through the __init__. Thanks for you

Re: Exclude fields in form by language

2008-11-14 Thread Malcolm Tredinnick
On Fri, 2008-11-14 at 10:44 -0800, Brandon Taylor wrote: > Hi Malcom, > > So, I manged to pass in the language_code parameter successfully: > > class CreditApplicationForm(forms.Form): > > def __init__(self, language_code, *args, **kwargs): > self.language_code = language_code >

Re: Exclude fields in form by language

2008-11-14 Thread Brandon Taylor
Hi Malcom, So, I manged to pass in the language_code parameter successfully: class CreditApplicationForm(forms.Form): def __init__(self, language_code, *args, **kwargs): self.language_code = language_code super(CreditApplicationForm, self).__init__(*args, **kwargs) The prob

Re: Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
Thanks Malcom, I'll give that a shot. Cheers, Brandon On Nov 13, 10:47 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-11-13 at 20:36 -0800, Brandon Taylor wrote: > > Hi Malcom, > > > This is what I have so far, but is not working... > > > #forms.py > > class CreditApplicationFo

Re: Exclude fields in form by language

2008-11-13 Thread Malcolm Tredinnick
On Thu, 2008-11-13 at 20:36 -0800, Brandon Taylor wrote: > Hi Malcom, > > This is what I have so far, but is not working... > > #forms.py > class CreditApplicationForm(forms.Form): > def __init__(language_code, *args, **kwargs): > super(CreditApplicationForm, self).__init__(*args, *

Re: Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
Hi Malcom, This is what I have so far, but is not working... #forms.py class CreditApplicationForm(forms.Form): def __init__(language_code, *args, **kwargs): super(CreditApplicationForm, self).__init__(*args, **kwargs) class Meta(): #trying to call self.language_code her

Re: Exclude fields in form by language

2008-11-13 Thread Malcolm Tredinnick
On Thu, 2008-11-13 at 18:06 -0800, Brandon Taylor wrote: > Hi everyone, > > I'm doing an internationalization project and have a form with fields > that need to be localized. I would like to have one form, pass in the > language code and exclude the appropriate fields. > > How would I go about

Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
Hi everyone, I'm doing an internationalization project and have a form with fields that need to be localized. I would like to have one form, pass in the language code and exclude the appropriate fields. How would I go about passing in the variable to the form? I know I have to pick it up in the