--On 18. Oktober 2006 16:15:37 +0200 Garito <[EMAIL PROTECTED]> wrote:
Hi all! How can I control the way an attribute of a product is readed? __getattr__? __getattribute__? I try the __getattribute__ way but it modifies the property pages Example: I create an object instance of the product and like: Property1 = 'Some text' Property2 = 2006-10-18 I would like to call Property2 like object.Property2 and retrieve the data with the current locale
Don't do that. Make a clear separation between the storage layer and any kind of presentation issues. If you need your internal data represented in a fancy way, write a dedicated accessor method and use this one inside your templates (or whatever) instead of accessing the data directly.
-aj
pgpT0b4D9f9Xi.pgp
Description: PGP signature
_______________________________________________ Zope maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
