Re: Schema-by-interface options
Martin Aspeli <[email protected]> Sat, 09 Sep 2006 12:30:05 +0100
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
Rocky Burt wrote: > On Fri, 2006-08-09 at 08:29 -0700, Martin Aspeli wrote: >> >> Sidnei da Silva-2 wrote: >>> | 2) Add a particular schema field to a number of content types (e.g. add >>> a >>> | "tags" field to all or some content types when a tagging solution is >>> | installed) >>> >>> If you need to do that your model is fatally flawed. We should >>> research instead about ways of 'merging' different schema/forms into a >>> single one at the presentation level. >>> >> Otherwise known as Archetypes. > > Personally I'd rather see ways of improving Archetypes/formlib > integration so you could possible generate formlib views based on > multiple AT schema's, etc. That sounds conceptually interesting, but I don't think anyone really has a clear idea of how this would work. When I first started looking at this, I was contemplating options for making things like base_edit, the validators and the save-handlers pull information from multiple sources and dispatch form data back to those sources after submit, but this would require a fairly substantial rewrite of AT's form generation and probably other parts as well. In the meantime, my proposal is fairly low-risk and could bring a lot of benefits quickly (witness the amount of people who ask, "I'd like to add some company-specific metadata to each content type on my site" and get the answer "oh, erm, well, you could subclass everything, or you could monkey patch BaseObject"). In fact, Ben once said that the reason we made Schema() a method in the first place was that we wanted to make it possible to pull the schema in from other sources than just a class-attribute. > Peronally these days I'm extending all of my existing archetypes with > zope 3 schema's and formlib :) Sadly, I don't think this is a viable option for most people at the moment. Widget richness is one thing, documentation another. For people starting from scratch, it may be a possibility (though like it or not, AT has been meeting our use cases for quite some time), but if you are talking about extending ATCT or extending someone else's set of content types, then it's an either-or proposition. In other words - I think making the AT schemas a bit more flexible is a quick-win that can benefit a lot of people today, and would not detract from any future efforts to bridge the gaps between AT and formlib. If anything, I would've thought further decoupling in AT itself would aid that kind of work. Martin (still wanting to do this) ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642