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

Roger ineichen dev at projekt01.ch
Sat Mar 6 15:17:53 EST 2004


It's not possible to add a content class with a python method
if you use the Object(field) in a schema. 

You can just do that over TTW.

I think we have to find a way for to configure, how the content
classes are created, in ZCML.

see below why...


> Garrett Smith wrote
> > Roger ineichen wrote:
> > Does this mean that we have to declare edit views "edit.html"?
> 
> You can't rely on a) an edit view existing for an object, 
> much less b) 
> that view having the name "edit.html".

Don't forget, we have application logic in the edit view if you use
CustomWidgetFactory and that means you only declare how
the Object(field) are created in this view. And which content object
are used for this Object(field).

> > What I missing is:
> > If I write python classes and I get a object from a folder with 
> > self.__getitem__('aName'). Then I whould like to give back 
> the object 
> > with a edit view. But we don't have a standard way for to 
> do that in 
> > Zope3. Except hoppe that anybody is declare the view as "edit.html"
> 
> I prefer self['aName'] over self.__getitem__('aName'), but that's 
> another issue :-)
> 
> > The reason is for to get on this view, we have additional
> > configuration information in the view. (CustomWidgetFatory)
> > This are configuration information how future objects
> > are created. 
> > 
> > My main question should be:
> > Can we take this important information how a object is
> > created out of the edit view (CustomWidgetFatory)
> > to somewhere else like ZCML? 
> 
> I think this falls into the realm of widgets, which are views 
> to objects 
> that are intended for use within pages (or forms). I don't have any 
> first hand experience with the object widget, but you might 
> experiment 
> with it -- take a look at the tests for it, as they're the only real 
> clue into its use:
> 
>    zope/app/browser/form/tests/test_objectwidget.py
> 
> I'm inclined to write an ftest for this creature, which would 
> give me an 
> idea of how (well) it works. Rumor has it, though, that it 
> can be used 
> for the sort of thing you're doing.

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. 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. On another server perhaps you
whould like to add (XYChild) to the content class (AContent)

Should we find another way for to declare this information?
Or do I have a special use/wish? 

I think we loos very important information this way.
 

Thanks 
Roger
>   -- Garrett
> 
> 
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org http://mail.zope.org/mailman/listinfo/zope3-dev
> 




More information about the Zope3-dev mailing list