Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20718

Re: Reset static variables or a workaround

References <9a1910c3-ccb0-493a-9756-4c6264e7c3b6@o4g2000pbc.googlegroups.com>
Date 2012-02-23 01:43 -0800
Subject Re: Reset static variables or a workaround
From Chris Rebert <clp2@rebertia.com>
Newsgroups comp.lang.python
Message-ID <mailman.68.1329990223.3037.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Feb 23, 2012 at 1:26 AM, Nav <navkirats@gmail.com> wrote:
> 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?

I infer that your question concerns Django. You might want to ask on
their discussion group instead:
http://groups.google.com/group/django-users

Cheers,
Chris

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Reset static variables or a workaround Nav <navkirats@gmail.com> - 2012-02-23 01:26 -0800
  Re: Reset static variables or a workaround Chris Rebert <clp2@rebertia.com> - 2012-02-23 01:43 -0800
  Re: Reset static variables or a workaround Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-02-23 11:18 +0100

csiph-web