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 your help, I really appreciate it.
b

On Nov 14, 7:34 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> 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
> >         super(CreditApplicationForm, self).__init__(*args, **kwargs)
>
> > The problem I have now is accessing that parameter in the Meta
> > subclass:
>
> >     class Meta:
> >         self.language_code    #returns: self is not defined.
>
> > Do you know how I can access that self.language_code parameter in the
> > Meta subclass?
>
> You don't. Repeating myself from earlier, the Meta class is parsed at
> import time, not creation time. There's no concept of "self" there. You
> need to adjust the internal structure of the form in the __init__()
> method. Things like Meta are for static form structures, not ones where
> they are highly dynamic in structure.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
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