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 passing in the variable to the form? I know I
> have to pick it up in the __init__ of the form, just don't know the
> correct syntax to do so.

You subclass the Form object anyway, so you need to write an __init__
method that also accepts this extra parameter. Then you pass in the
extra parameter to the form yourself whenever you instantiate the form.

Forms are just Python classes. So you customise them like any normal
class. Django isn't going to do anything special to help or hinder you
there.

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