[Zope] problem with superValues

Andreas Jung Andreas Jung <lists@andreas-jung.com>
Fri, 07 Mar 2003 20:28:25 +0100


Wrap your code into manage_afterAdd()

-aj

--On Freitag, 7. M=E4rz 2003 14:20 -0500 Jens Vagelpohl <jens@zope.com> =
wrote:

> during __init__ your object has no acquisition content. you cannot use
> acquisition at that point in time.
>
> jens
>
>
> On Friday, Mar 7, 2003, at 14:12 US/Eastern, Steffen Hausmann wrote:
>
>> Hi,
>>
>> Im trying to send an E-Mail within an external python script each time
>> an object is edited. Therefor I use superValues to locate the MailHost
>> object.
>>
>> mailhost=3Dgetattr(self, self.superValues('Mail Host')[0].id)
>>
>> If the object that sends the mail already exists anything goes fine.
>>
>> But if the object is edited for the first time (via the __init__
>> procedure that calls the edit procedure) superValues can't find the
>> MailHost object (IndexError: list index out of range).
>>
>> Any ideas what's going wrong?
>>
>> MfG Steffen
>
>
> _______________________________________________
> 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"               -
    ---------------------------------------------------------------------