[Zope3-dev] TTW Schema-based content types

Sidnei da Silva sidnei@plone.org
Mon, 4 Aug 2003 15:24:52 -0300


On Mon, Aug 04, 2003 at 02:10:59PM -0400, Jim Fulton wrote:
| >  def getFactoriesFor(iface):
| >    """ Return a list of factories that creates object which implement
| >    the given interface """
| >
| >Looks good?
| 
| Yes, although the doc string isn't formatted correctly. :)

:P

| >Ok, I had some trouble figuring out where this would take me, but I
| >think I see it now. I think that when we have a TTW Schema registered
| >with the interface service, the next step for creating a content
| >object is registering a factory for our TTW Schema. This factory could
| >also use a 'mixin' class of choice or other fancy stuff one would want
| >plus the class Jim suggested (with custom __**attr__) and generate a
| >content object. We can also need to provide an additional list of
| >interfaces this object will implement.
| 
| I wouldn't use a mix-in class. I'd just use a single class to implement
| the factory that uses the interface on an instances. IOW, I would not
| generate a class for the schema.

Yes, sorry. See more details below.

| >The third important thing is assigning security permissions to the TTW
| >Schema. Stephan Richter says that he has code for that in the workflow
| >package.
| 
| Hm. Good point.
| 
| >The fourth important thing is registering views for our TTW
| >Schema. AFAICT, the current machinery is already able to do this,
| >provided that we have the interface in place. (We have a local view
| >service, dont we?)
| 
| Yup.
| 
| >Is there something else missing here?
| >
| >Now to the next level (or back to the black board):
| >
| >For generating the so called TTW Schema, there is some stuff in place
| >under the schemagen package, that Steve and Faassen wrote up back in
| >December. No one seems to be using it, AFAICT, but it looks like we
| >can get very close to what we want by starting from there. Any objections?
| 
| I didn't think schemagen actually had a schema editing UI.  I think the 
| emphasis
| in schemagen is to generate classes, and maybe schema in persistent modules.
| IOW, it generates code.  This was driven by the fact that persistent classes
| must be in modules. Schemas need not have this limitation. And if you don't 
| generate
| a class, there's no class code to put in a module.

Oh, in my case (SQLObject integration) I'll need to generate a class,
but that can be done on the factory given that I have a schema and a
base class (which can be fixed to the base SQLObject class). I don't
necessarily need to have this class be persisted into a module, unless
its a requirement that it needs to be persisted. 

So that means that as long as the class doesn't need to be persisted
one can go along with TTW Schema having UI to generate a Schema and a
custom factory?

[]'s
-- 
Sidnei da Silva <sidnei@plone.org>
dreamcatching :: making your dreams come true
http://dreamcatcher.homeunix.org

"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)