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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to