gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUe] Need help with triggers


From: Amil Ganju
Subject: Re: [GNUe] Need help with triggers
Date: Fri, 4 May 2007 12:54:44 +0530

I had tried session.find(). But when I run my gfd I get an error message saying it cannot find metadata. Both these classes belong to a module called 'crm'. i tried the following:

customerIndex = session.find (crm_metadata)
customerIndex = session.find(metadata)

I get the same error.

NameError: name 'crm_metadata' is not defined
NameError: name 'metadata' is not defined

Also while we are at this I had another query. How can I delete entries from a detail class from an OnDelete trigger on the master class.

Regards
Amil Ganju


On 5/3/07, Reinhard Mueller <address@hidden> wrote:
Hi, Amil!

Am Donnerstag, den 03.05.2007, 18:06 +0530 schrieb Amil Ganju:
> I'm writing an OnInit trigger in a class customer. The trigger has to
> fetch data from another class called metadata in the same module. I
> can't seem to figure out the python syntax to do so. The documentation
> doesn't elaborate too much either.

It depends whether the other data (metadata) is referenced from customer
or not.

If customer references metadata by, say, a property named my_meta, you
would do a
m = self.my_meta

If metadata is a separate, non-related class, you would use session.find
as described at
http://www.gnuenterprise.org/tools/appserver/docs/manual/devguide/Procedures.html Section 6.4.2.

If you have further questions, just ask.

Thanks,
--
Reinhard Mueller
GNU Enterprise project ( http://www.gnuenterprise.org)

_______________________________________________
Gnue mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnue




reply via email to

[Prev in Thread] Current Thread [Next in Thread]