Re: [Zope-dev] ZPatterns and Properties that are objects
Thanks Philip >The way Ty and I usually handle "object" properties is to give an object >setter methods (e.g. "setAddress()") that simply set the property (e.g. >self.Address = addr). The only downside is that you have to do this in a >Python base class or an External method. Later, we expect to replace this >approach with PropertyHandlers, and we already have a primitive form of >PropertyHandler we have used with some success, but it's too crude at this >point for a product release. I presume if most of my classes are ZClasses external methods should do the job and then I can just call the setter methods when the object is created or modified? >I have created ObjectManager and Folder dataskins before and had them work, >but at the time I was testing with Zope 2.1.6, and it was an older version >of ZPatterns. I haven't done much lately with them. If people are >experiencing problems, perhaps someone could send me a bug report? If I do try out this route (in stead of using setter methods) where does the content of the ObjectManager reside - sometimes I struggle with the locality of objects when working with ZPatterns. Eg. I have a CustomerManager specialist that creates Customers (Objectmanager Dataskin) and that should contain an address dataskin. I guess a simple prodding of the namespace should do the trick but are not to clear on how this should be done? guessing (but the manage_addProduct part is probably not right): Roché - Sleep for entertaiment Willow http://www.dreamscapes.co.za ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and Properties that are objects
At 01:01 PM 11/7/00 +0200, Roch'e Compaan wrote: > >I created a couple of ZClasses based on Dataskin. > >In the way I grok ZOPE, properties that are objects can not go onto property >sheets. So if I have a Customer ZClass that has a property Address (a >property that is an object) then I would create the address object as a >"method" of the Customer that makes references like Customer.Address.Street >possible. The way Ty and I usually handle "object" properties is to give an object setter methods (e.g. "setAddress()") that simply set the property (e.g. self.Address = addr). The only downside is that you have to do this in a Python base class or an External method. Later, we expect to replace this approach with PropertyHandlers, and we already have a primitive form of PropertyHandler we have used with some success, but it's too crude at this point for a product release. >To achieve this without ZPatterns I would base my ZClass on a objectmanager >so that I can create an instance of an Address object within Customer. So >how does one do this with ZPatterns. In one posting I picked up that one >does not have much joy with ZPatterns and the ObjectManger base class? I have created ObjectManager and Folder dataskins before and had them work, but at the time I was testing with Zope 2.1.6, and it was an older version of ZPatterns. I haven't done much lately with them. If people are experiencing problems, perhaps someone could send me a bug report? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns and Properties that are objects
On the Road: I created a couple of ZClasses based on Dataskin. In the way I grok ZOPE, properties that are objects can not go onto property sheets. So if I have a Customer ZClass that has a property Address (a property that is an object) then I would create the address object as a "method" of the Customer that makes references like Customer.Address.Street possible. To achieve this without ZPatterns I would base my ZClass on a objectmanager so that I can create an instance of an Address object within Customer. So how does one do this with ZPatterns. In one posting I picked up that one does not have much joy with ZPatterns and the ObjectManger base class? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )