Reset static variables or a workaround

Nav navkirats at gmail.com
Thu Feb 23 10:26:21 CET 2012


Hi Guys,

I have a custom user form class, it inherits my own custom Form class:

class UserForm(Form):
    first_name = TextField(attributes={id='id_firstname'})

Now, everytime UserForm() is instantiated it saves the attributes of
each form members and passes it on to the new instance. I understand
this is because first_name is static in nature. But I would like to
reset the first_name for every instance? How can I do this?

Regards,
Nav



More information about the Python-list mailing list