[Zope3-Users] Re: How to extend File?

John Toews jtoews at academiccolab.org
Fri Nov 19 15:20:27 EST 2004


With essentially the code below (I forgot the guid = '' in ContentBase) and the proper includes, I used the browser:addMenuItem directive in my configure.zcml. I can add an item but not manage it (clicking on it results in a ForbiddenAttribute error for 'contentType' on ContentBase).

I am wondering if I should be using the content directive in the zcml?

Or if I need my own __init__ in ContentBase?

Thanks!

-----Original Message-----
From: zope3-users-bounces at zope.org [mailto:zope3-users-bounces at zope.org] On Behalf Of jürgen Kartnaller
Sent: Thursday, November 18, 2004 2:00 PM
To: zope3-users at zope.org
Subject: [Zope3-Users] Re: How to extend File?

This works well for me.
I used a configure.zcml by following Stephan Richters Zope 3 book.
I'm now able to add a new file object with a guid field.

You should give us the traceback of the system error.

Jürgen

John Toews wrote:
> Hi all,
> 
> I'm trying to do something I thought would be very simple. I think I 
> don't understand the Component Architecture well enough...
> 
> I want to take the base File and simply add a property to it (a string 
> representing a guid). That's all, everything else would remain the same.
> I've tried a couple different ways of doing:
> 
> class IContentGuid(Interface):
> 	guid = TextLine(title=_('guid desc'))
> 
> class ContentBase(File):
> 	zope.interface.implements(IContentGuid)
> 
> And various configure.zcml setups. I can't really explain what's going 
> wrong either. The best I've gotten is a link in the ZMI to 
> ContentBase, which when clicked on will add an item, but after typing 
> in a name and hitting Apply, a system error occurs. I think I'm just 
> on the wrong track.
> 
> Any ideas on what (all) I'm doing wrong?
> Thanks!
> John

_______________________________________________
Zope3-users mailing list
Zope3-users at zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


More information about the Zope3-users mailing list