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


Groups > comp.lang.python > #20718

Re: Reset static variables or a workaround

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <chris@rebertia.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'attributes': 0.05; 'django.': 0.05; 'passes': 0.05; 'instance.': 0.09; 'am,': 0.12; 'class,': 0.15; 'class:': 0.16; 'guys,': 0.16; 'instantiated': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'this?': 0.19; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'discussion': 0.22; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'static': 0.24; 'cc:2**0': 0.26; 'message-id:@mail.gmail.com': 0.29; 'class': 0.29; 'cc:addr:python.org': 0.29; 'nature.': 0.30; 'chris': 0.30; 'thu,': 0.32; 'received:209.85.214': 0.36; 'question': 0.36; 'saves': 0.37; 'members': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'reset': 0.40; 'user': 0.40; 'might': 0.40; 'header:Received:6': 0.61; 'custom': 0.61; 'your': 0.61; 'concerns': 0.80; 'sender:addr:chris': 0.84
Received-SPF pass (google.com: domain of chris@rebertia.com designates 10.204.152.145 as permitted sender) client-ip=10.204.152.145;
Authentication-Results mr.google.com; spf=pass (google.com: domain of chris@rebertia.com designates 10.204.152.145 as permitted sender) smtp.mail=chris@rebertia.com; dkim=pass header.i=chris@rebertia.com
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hG3Lo9EYh+/ZJbk02p2pSeDikMidJ/COmVA56pb0XQQ=; b=A09XFwqySGYN7wQgfahnyk3goWv7p2DBq+XpBLtxVSgzkbFQ3OrztY49y5LSqdsV9C fQcHFXErZzLreJvZfFxK+XGltgJzY84r8MsnA8zANVqoCnCOR9zhQkRHVk+X8ff0XmsO Ofhy8kggtaJFusQrB4C4T5iJqEPO/OENtJKyo=
MIME-Version 1.0
Sender chris@rebertia.com
In-Reply-To <9a1910c3-ccb0-493a-9756-4c6264e7c3b6@o4g2000pbc.googlegroups.com>
References <9a1910c3-ccb0-493a-9756-4c6264e7c3b6@o4g2000pbc.googlegroups.com>
Date Thu, 23 Feb 2012 01:43:42 -0800
X-Google-Sender-Auth A_kqoZx5NaWTJaB74ShmCtMbMRM
Subject Re: Reset static variables or a workaround
From Chris Rebert <clp2@rebertia.com>
To Nav <navkirats@gmail.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Gm-Message-State ALoCoQmocTHRzXFwM7hXbHPDJRqMToqs7VgwgAEAQei8SSgSLAPqblPkF3eefxmKRlt7iJ6ZZWHi
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.68.1329990223.3037.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329990223 news.xs4all.nl 6932 [2001:888:2000:d::a6]:39015
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20718

Show key headers only | 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