[Product-Developers] Re: schemaextender issue: Unauthorized: You are not allowed to access 'set' in this context

Hanno Schlichting plone at hannosch.info
Thu Jan 24 21:24:10 UTC 2008


Hi,

I think this has nothing to do with schemaextender.

Héctor Velarde wrote:
> results = context.portal_catalog.searchResults(portal_type='News Item')
> for item in results:
>     obj = item.getObject()
>     schema = obj.Schema()
>     byline = schema.getField('byline')
>     byline.set(obj, 'Me')

The set method of all Fields is private. You need to use the generated 
accessor and mutators.

So obj.setByline('Me') should work instead.

Hanno





More information about the Product-Developers mailing list