[Zope3-dev] Re: AW: Re: edit view of a object unknown?

Jim Fulton jim at zope.com
Sat Mar 6 18:32:29 EST 2004


Garrett Smith wrote:
> Roger ineichen wrote:
> 
>> Object(fields) and ObjectWidgetFactory working very well.
>> But thake a look a the following problem;
>>
>> Declare a content class (AContent) and use a schema with a field Object.
>> Write a edit view and declare how the Object is used. That means
>> you have to define which content class is added to the defined
>> Object(field) let's say you add (BChild), which is also a content class.
>> Later, if you write a product, you can't add such a (AContent) class 
>> in a python method to a folder or somewhere because you don't have the 
>> information which class is added to the (AContent)
>> class.

You can use any class you want, as long as it satisfies the constraint.


 >> In the sample above this whould be (BChild). But this
>> relays to the configuration in the edit view. And the edit view is
>> just one way of implementation.

Yes

 >> On another server perhaps you
>> whould like to add (XYChild) to the content class (AContent)

Yes

> 
> Ah...now I'm understanding.
> 
> Schema provide a way of constraining (existing) objects. They don't say 
> much about how an object is created/initialized.

Right

> We currently rely on add forms to create and initialize objects, which 
> makes accessing factory/initialization logic pretty hard (which is 
> exactly your point :-)

Hard for whom?

> I know Jim and others have done some thinking in this area -- there's 
> agreement that this needs some attention.

I don't know what this is.  I can't tell what Roger is trying to do.

> Jim, if you're lurking :-) could you fill in some of the pieces here? We 
> had briefly covered some of the factory/initialization issues 
> surrounding the add form, but I've already forgotten the details :-o

I don't think they are relevent.

Roger, I can't really tell what you want to do.  It seems as though you want
to be able to create objects from Python without knowing anything about
their constructors.  This really only works, in general if the constructors
take no arguments.

Roger, could you explain what you are trying to do?

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list