[Zope] object manager - getOb(...) - parameter '_marker'
Pascal Peregrina
Pperegrina at Lastminute.com
Tue Dec 7 06:42:55 EST 2004
If the object is not found, this raises an Exception unless you have
explicitely given a default value (in that case that value is returned).
So _marker is just used to know if a default value has been given by the
caller (and that value can be None).
Pascal
-----Message d'origine-----
De : zope-bounces at zope.org [mailto:zope-bounces at zope.org]De la part de
friedrich steindl
Envoyé : mardi 7 décembre 2004 12:47
À : zope at zope.org
Objet : [Zope] object manager - getOb(...) - parameter '_marker'
hi,
can somebody give me a hint what the parameter '_marker' is meant for in
this
code of the zope object manager -
def _getOb(self, id, default=_marker):
# FIXME: what we really need to do here is ensure that only
# sub-items are returned. That could have a measurable hit
# on performance as things are currently implemented, so for
# the moment we just make sure not to expose private attrs.
if id[:1] != '_' and hasattr(aq_base(self), id):
return getattr(self, id)
if default is _marker:
raise AttributeError, id
return default
_marker ist declared as an empty list at the beginning of the module, but outside of the object manager class
... and as i believe has something to do with the path to (container of) the
object ???
thx for any hints
steindl friedrich
(-:fs)
_______________________________________________
Zope maillist - Zope at 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 )
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
More information about the Zope
mailing list