RE: [Zope-dev] ZClass Instances
How about just using meta_type? on the zclass this'll be 'Z Class' and on an instance of the ZClass, it'll be that meta_type. _____________________________________________________ Tim McLaughlin iterationZERO - www.iterationzero.com 703-481-2233
Message: 6 From: "Edgardo Zulian" <ezulian@elsitio.com.ar> To: <zope-dev@zope.org> Subject: [Zope-dev] ZClass Instances Date: Wed, 25 Jul 2001 09:41:15 -0300
Hi,
I have a zclass, which have a propertysheet with some properties like multiple lines, strings, etc.. which have some default values that i assigned to them. When i create an instance of that zclass and i change the value of a property, then the instance does not reflect any more the changes that i make to the zclass, which is okey.
So the question is: There is a way to know using an external method or with a dtml, if an instance is different from the zclass?
Thanks..
Edgardo
Yes, but i know that the object is an instance of a zclass, what i want to know if the instance propertysheets's properties (lines, string, multiple lines) have de same values as the zclass have. For example if i have a zclass 'x' with a string in the propertysheets wich a default value, when i create an instance of that zclass 'x1' it has that value on the property string, but if i change that value to another, then when i change de default value of the zclass, the value of the instance will not change. So how can i recognize when an instance do not take the changes that i make to the zclass? Thanks Edgardo ----- Original Message ----- From: "Tim McLaughlin" <tim@iterationzero.com> To: <zope-dev@zope.org>; <ezulian@elsitio.com.ar> Sent: Wednesday, July 25, 2001 1:08 PM Subject: RE: [Zope-dev] ZClass Instances
How about just using meta_type? on the zclass this'll be 'Z Class' and on an instance of the ZClass, it'll be that meta_type.
_____________________________________________________ Tim McLaughlin iterationZERO - www.iterationzero.com 703-481-2233
Message: 6 From: "Edgardo Zulian" <ezulian@elsitio.com.ar> To: <zope-dev@zope.org> Subject: [Zope-dev] ZClass Instances Date: Wed, 25 Jul 2001 09:41:15 -0300
Hi,
I have a zclass, which have a propertysheet with some properties like multiple lines, strings, etc.. which have some default values that i assigned to them. When i create an instance of that zclass and i change the value of a property, then the instance does not reflect any more the changes that i make to the zclass, which is okey.
So the question is: There is a way to know using an external method or with a dtml, if an instance is different from the zclass?
Thanks..
Edgardo
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
Have you tried using the __class__ attribute of the instance to compare the the two? Maybe do a propertyIds, and compare getattr(self,id) to getattr(self.__class__, id)? I'm just guessing though cause I haven't tested either of these methods. Tim
-----Original Message----- From: Edgardo Zulian [mailto:ezulian@elsitio.com.ar] Sent: Wednesday, July 25, 2001 1:45 PM To: tim@iterationzero.com; zope-dev@zope.org Subject: Re: [Zope-dev] ZClass Instances
Yes, but i know that the object is an instance of a zclass,
what i want to know if the instance propertysheets's properties (lines, string, multiple lines) have de same values as the zclass have.
For example if i have a zclass 'x' with a string in the propertysheets wich a default value, when i create an instance of that zclass 'x1' it has that value on the property string, but if i change that value to another, then when i change de default value of the zclass, the value of the instance will not change. So how can i recognize when an instance do not take the changes that i make to the zclass?
Thanks Edgardo
----- Original Message ----- From: "Tim McLaughlin" <tim@iterationzero.com> To: <zope-dev@zope.org>; <ezulian@elsitio.com.ar> Sent: Wednesday, July 25, 2001 1:08 PM Subject: RE: [Zope-dev] ZClass Instances
How about just using meta_type? on the zclass this'll be 'Z Class' and on an instance of the ZClass, it'll be that meta_type.
_____________________________________________________ Tim McLaughlin iterationZERO - www.iterationzero.com 703-481-2233
Message: 6 From: "Edgardo Zulian" <ezulian@elsitio.com.ar> To: <zope-dev@zope.org> Subject: [Zope-dev] ZClass Instances Date: Wed, 25 Jul 2001 09:41:15 -0300
Hi,
I have a zclass, which have a propertysheet with some
properties like
multiple lines, strings, etc.. which have some default values that i assigned to them. When i create an instance of that zclass and i change the value of a property, then the instance does not reflect any more the changes that i make to the zclass, which is okey.
So the question is: There is a way to know using an external method or with a dtml, if an instance is different from the zclass?
Thanks..
Edgardo
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
Edgardo Zulian writes:
what i want to know if the instance propertysheets's properties (lines, string, multiple lines) have de same values as the zclass have. The easiest way is probably to instantiate a Z Instance at some place that you do not modify. You can then check the properties of your target instance against that reference instance.
Dieter
Yes, but i think that perhaps there is a method or an attribute like meta_type or something that tells if an instance of a zclass will not take anymore the changes that are made to the zclass.... ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Edgardo Zulian" <ezulian@elsitio.com.ar> Cc: <tim@iterationzero.com>; <zope-dev@zope.org> Sent: Thursday, July 26, 2001 4:36 PM Subject: Re: [Zope-dev] ZClass Instances
Edgardo Zulian writes:
what i want to know if the instance propertysheets's properties (lines, string, multiple lines) have de same values as the zclass have. The easiest way is probably to instantiate a Z Instance at some place that you do not modify. You can then check the properties of your target instance against that reference instance.
Dieter
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
participants (3)
-
Dieter Maurer -
Edgardo Zulian -
Tim McLaughlin