gnue
[Top][All Lists]
Advanced

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

Re: [GNUe] a simple trigger (gnue-forms)


From: Jason Cater
Subject: Re: [GNUe] a simple trigger (gnue-forms)
Date: Wed, 14 Apr 2004 21:30:39 -0500
User-agent: KMail/1.6.1

> Yet, i'd like to understand better how does gnue-forms work.
> I thought that the objects that are available inside the triggers
> are instances of the GFBlock, GFField, etc classes.
> In my case this would mean that blkProd.fldVal are blkProd.fldPu are
> instances of the GFField class.
> However: looking at this class, i don't see the set() and get() methods.
> Where should I look when i want to know what methods does a
> particular object (like blkProd,  fldVal, etc)  have ?

Adrian, 

The GFField, GFBlock, etc, objects are not directly accessible from triggers. 
We felt this best for security and code cleanliness reasons. 

In your trigger namespaces, we actually put a wrapper object, which exposes 
pre-defined functions of the underlying main object (i.e. GFField, etc.)

We are trying to document all available functions in the Form Developer's 
Guide, Appendix C. However, if you are looking at the Python source code, 
each GF* object will define a dictionary: 

    self._triggerFunctions={'allowedValues':{'function':self.allowedValues,},
            'autofillBySequence': 
                       {'function':self.triggerAutofillBySequence},
            'isEmpty':{'function':self.isEmpty},
            'resetForeignKey':{'function':self.resetForeignKey},
            'set':{'function':self.triggerSetValue},
            'get':{'function':self.getValue},
            'clear': {'function': self.resetToDefault}
     }

This contains a mapping of exposed triggers functions and which python method 
they actually call. 

Given the above snippet from GFField.py, if you call 
field.autofillBySequence() in a trigger, then 
GFField.triggerAutofillBySequence() is actually run. 

-- Jason 




reply via email to

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