[Zope] error with setattr
Andreas Jung
Andreas Jung <lists@andreas-jung.com>
Sun, 02 Mar 2003 17:25:44 +0100
setattr(obj, key, value).
-aj
--On Sonntag, 2. M=E4rz 2003 17:08 +0100 Fernando Martins=20
<fmartins@hetnet.nl> wrote:
> Hi,
>
> I tried this simple script (adapted from the Python tutorial):
> __________________
> class Record:
> pass
>
> obj=3DRecord()
> obj.setattr('field1',1)
> print obj
> return printed
> __________________
>
> and got this error
>
> Error Type: AttributeError
> Error Value: Record instance has no attribute 'setattr'
>
> Why is it not working?
>
> Fernando
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
--=20
---------------------------------------------------------------------
- Andreas Jung http://www.andreas-jung.com -
- EMail: andreas at andreas-jung.com -
- "Life is too short to (re)write parsers" -
---------------------------------------------------------------------