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

bad_my84 bas.roijen at cofely-gdfsuez.nl
Tue Sep 8 14:05:20 UTC 2009


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?

Thanks in advance!

Traceback:
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.CMFPlone.FactoryTool, line 368, in __call__
  Module Products.CMFPlone.FactoryTool, line 152, in __getitem__
  Module Products.CMFPlone.PloneFolder, line 348, in invokeFactory
  Module Products.CMFCore.TypesTool, line 716, in constructContent
  Module Products.CMFCore.TypesTool, line 276, in constructInstance
  Module Products.CMFCore.TypesTool, line 450, in _constructInstance
  Module Products.PFPOnline.content.Afspraken, line 7, in addAfspraken
  Module OFS.ObjectManager, line 348, in _setObject
  Module zope.event, line 23, in notify
  Module zope.component.event, line 26, in dispatch
  Module zope.component._api, line 130, in subscribers
  Module zope.component.registry, line 290, in subscribers
  Module zope.interface.adapter, line 535, in subscribers
  Module zope.component.event, line 33, in objectEventNotify
  Module zope.component._api, line 130, in subscribers
  Module zope.component.registry, line 290, in subscribers
  Module zope.interface.adapter, line 535, in subscribers
  Module Products.CMFCore.CMFCatalogAware, line 249, in
handleContentishEvent
  Module Products.Archetypes.CatalogMultiplex, line 36, in indexObject
  Module Products.CMFPlone.CatalogTool, line 385, in catalog_object
  Module Products.ZCatalog.ZCatalog, line 536, in catalog_object
  Module Products.ZCatalog.Catalog, line 339, in catalogObject
  Module Products.ZCatalog.Catalog, line 277, in updateMetadata
  Module Products.ZCatalog.Catalog, line 416, in recordify
  Module Products.CMFPlone.CatalogTool, line 110, in __getattr__
  Module Products.CMFPlone.CatalogTool, line 214, in getObjSize
  Module Products.Archetypes.BaseObject, line 588, in get_size
  Module Products.Archetypes.Field, line 817, in get_size
  Module Products.Archetypes.Field, line 728, in getRaw
  Module Products.Archetypes.utils, line 160, in mapply
  Module Products.Archetypes.ClassGen, line 56, in generatedAccessor
  Module Products.Archetypes.Field, line 839, in get
  Module Products.Archetypes.Field, line 710, in get
   - __traceback_info__: ('medewerker', <Afspraken at
/Plone/med2/portal_factory/Afspraken/afspraken.2009-09-08.7926306464>,
{'field': <Field medewerker(string:rw)>, 'schema':
<Products.Archetypes.Schema.Schema object at 0xa417f8c>, 'encoding': None})
  Module Products.Archetypes.Field, line 590, in getDefault
ValueError: medewerker.default_method is neither a method of <class
'Products.PFPOnline.content.Afspraken.Afspraken'> nor a callable
-- 
View this message in context: http://n2.nabble.com/AGX-neither-a-method-nor-a-callable-tp3603494p3603494.html
Sent from the Product Developers mailing list archive at Nabble.com.




More information about the Product-Developers mailing list