[Product-Developers] Re: AGX neither a method nor a callable

Maurits van Rees m.van.rees at zestsoftware.nl
Tue Sep 8 14:12:10 UTC 2009


bad_my84, on 2009-09-08:
>
> Hi all,
>
> I'm developing my own product in archgenxml but I'm running into problems
> with a default_method.
> I have 2 simple classes: employee and agreement. Agreement is contained in
> employee (composition).
> In agreement there is a StringField (called employee) which I want to give
> the default of employee title.
>
> To the employee StringField I added the tagged value 'default_method:
> findParentTitle'
> In Agreement.py I added the following code to the 'code-section
> after-local-schema':
>
>     security.declarePublic('findParentTitle')
>     def findParentTitle(self):
>         """
>         Populates the field with the title of its parent.
>         """
>         return self.aq_parent.getTitle()
>
> What am I missing here?

Try:
    return self.aq_parent.Title()

The title and description fields are exceptions to the rule that the
generated 'getter' of the field is 'get' plus the capitalized
fieldname.  The getters of these two fields are Title and Description.

I would expect a different error message though, so maybe this is
unrelated.

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]





More information about the Product-Developers mailing list