Method to return the properties of an object
Is there a method to return the properties of an object? Sorry if it's sth obvious!* *
You can create a small utility external method to call dir() and type() - very useful! Jonathan ----- Original Message ----- From: George To: zope@zope.org Sent: Friday, February 10, 2006 8:11 AM Subject: [Zope] Method to return the properties of an object Is there a method to return the properties of an object? Sorry if it's sth obvious! ------------------------------------------------------------------------------ _______________________________________________ Zope maillist - Zope@zope.org 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 )
How would you "shoot" yourself? ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Jonathan" <dev101@magma.ca> Cc: "George" <tesseris@gmail.com>; <zope@zope.org> Sent: Friday, February 10, 2006 8:36 AM Subject: Re: [Zope] Method to return the properties of an object
Jonathan schrieb:
You can create a small utility external method to call dir() and ype() - very useful!
There are easier ways to shot yourself in the foot :-)
Jonathan schrieb:
How would you "shoot" yourself?
dont you think these methods arent accessible from ZMI code by purpose? :-) Btw, for Properties and their types there are already API methods. So no need to put holes into your site security. Regards Tino
The idea of using an external method for dir/type is simply to allow a developer to quickly investigate attributes/methods of objects - if you are silly enough to actually incorporate this mechanism into 'production' code then you should shoot yourself. ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Jonathan" <dev101@magma.ca> Cc: <zope@zope.org> Sent: Friday, February 10, 2006 8:45 AM Subject: Re: [Zope] Method to return the properties of an object
Jonathan schrieb:
How would you "shoot" yourself?
dont you think these methods arent accessible from ZMI code by purpose? :-)
Btw, for Properties and their types there are already API methods. So no need to put holes into your site security.
Regards Tino
Jonathan schrieb:
The idea of using an external method for dir/type is simply to allow a developer to quickly investigate attributes/methods of objects - if you are silly enough to actually incorporate this mechanism into 'production' code then you should shoot yourself.
And how did you protect your external methods? :-) Btw: Hint - as developer, start a 2nd ZEO client via zopectl debug and use dir, type, help() interactively on your object tree :-) Regards Tino
Jonathan schrieb:
The idea of using an external method for dir/type is simply to allow a developer to quickly investigate attributes/methods of objects - if you are silly enough to actually incorporate this mechanism into 'production' code then you should shoot yourself.
And how did you protect your external methods? :-)
We develop on an internal server (no public/outside access), so security for developer utilities is not an issue.
Btw: Hint - as developer, start a 2nd ZEO client via zopectl debug and use dir, type, help() interactively on your object tree :-)
Good hint!
George wrote:
Is there a method to return the properties of an object?
Not sure what you're talking about... Properties as defined by the PropertySheet/PropertyManager API, or just attributes ? -- bruno desthuilliers développeur bruno@modulix.org http://www.modulix.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 George wrote:
Is there a method to return the properties of an object?
Sorry if it's sth obvious!*
For properties defined via the "Properties" tab, use the API defined in OFS.PropertyManager, e.g. 'propertyMap'. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD7JiY+gerLs4ltQ4RAhKnAKCSIx5apt9mabTVkh/4JkSizQ4JKwCggMuD i8vudlG9vI0POoDudbbAX/M= =gw2Q -----END PGP SIGNATURE-----
You could use any of a various set of introspection/debugging tools. One of them is http://svn.nuxeo.org/trac/pub/browser/ZMIntrospection/trunk/ There are others, like http://www.zope.org/Members/shh/DocFinderEverywhere Florent George wrote:
Is there a method to return the properties of an object?
Sorry if it's sth obvious!* *
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope-CWUwpEBWKX0@public.gmane.org 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 )
-- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (6)
-
bruno desthuilliers -
Florent Guillaume -
George -
Jonathan -
Tino Wildenhain -
Tres Seaver