Skip to content

Death to monkey-patching archetype schemas!

January 20, 2008

I’ve been using archetypes.schemaextender lately, to extend the Plone Event schema (in an effort to get useable recurring events). And it works. No big problems, and highly recommended.

Only problem: Well, as I understand it, you can really only have one extender per type. This is solvable by letting that type in return look up other “subextenders”, which is what I do, but it would have been nicer if this was supported already.

Update: Wiggy tells me  that you can have multiple extenders if you name them. I’ll try that.

An example of this will pop up in p4a.ploneevent shortly, which is the product that contain the recurring event support.


From → plone, zope

  1. Florian Schulze permalink

    You *can* have more extenders for each type, that was one of the first reasons for archetypes.schemaextender. You just register several *named* adapters on the same type, where the name itself is arbitrary, but to avoid conflicts you should use a dotted name related to you package name. The old way, where you wrote an adapter for ISchema directly only allowed one adapter.

  2. Roger Erens permalink

    This subject looks very much like extending a blog entry with comments! The only issue remaining is to attribute the correct name to a comment 🙂

  3. Actually Wiggy told it to me via IRC, about exactly at the same time as Florian did here on the blog. So I didn’t see Rogers comment until after I edited the page.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: