r13472 - in Products.Archetypes/trunk: . Products/Archetypes
"David Glick" <[email protected]> Wed, 16 Feb 2011 05:50:07 +0000
| Newsgroups | gmane.comp.web.zope.plone.archetypes.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: davisagli
Date: Wed Feb 16 05:50:06 2011
New Revision: 13472
Modified:
Products.Archetypes/trunk/ (props changed)
Products.Archetypes/trunk/CHANGES.txt
Products.Archetypes/trunk/Products/Archetypes/ (props changed)
Products.Archetypes/trunk/Products/Archetypes/ReferenceEngine.py
Products.Archetypes/trunk/Products/Archetypes/Referenceable.py
Log:
merge r13471 from 1.6 branch
Modified: Products.Archetypes/trunk/CHANGES.txt
==============================================================================
--- Products.Archetypes/trunk/CHANGES.txt (original)
+++ Products.Archetypes/trunk/CHANGES.txt Wed Feb 16 05:50:06 2011
@@ -4,6 +4,10 @@
1.7.3 - Unreleased
------------------
+- Remove method docstrings in Referenceable and ReferenceEngine to prevent
+ making them publishable.
+ [davisagli]
+
- Fixed handling of Anonymous ownership in ExtensibleMetadata, where the
ownership tuple is None. Also triggered for views on FactoryTool-wrapped
objects.
Modified: Products.Archetypes/trunk/Products/Archetypes/ReferenceEngine.py
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/ReferenceEngine.py (original)
+++ Products.Archetypes/trunk/Products/Archetypes/ReferenceEngine.py Wed Feb 16 05:50:06 2011
@@ -349,7 +349,7 @@
self._deleteReference(objects[0])
def deleteReferences(self, object, relationship=None):
- """delete all the references held by an object"""
+ # delete all the references held by an object
for b in self.getReferences(object, relationship):
self._deleteReference(b)
@@ -358,13 +358,14 @@
def getReferences(self, object, relationship=None, targetObject=None,
objects=True):
- """return a collection of reference objects"""
+ # return a collection of reference objects
return self._optimizedReferences(object, relationship=relationship,
targetObject=targetObject, objects=objects, attribute='sourceUID')
def getBackReferences(self, object, relationship=None, targetObject=None,
objects=True):
- """return a collection of reference objects"""
+ # return a collection of reference objects
+
# Back refs would be anything that target this object
return self._optimizedReferences(object, relationship=relationship,
targetObject=targetObject, objects=objects, attribute='targetUID')
@@ -440,9 +441,7 @@
return False
def getRelationships(self, object):
- """
- Get all relationship types this object has TO other objects
- """
+ # Get all relationship types this object has TO other objects
sID, sobj = self._uidFor(object)
brains = self._queryFor(sid=sID)
res = {}
@@ -452,9 +451,7 @@
return res.keys()
def getBackRelationships(self, object):
- """
- Get all relationship types this object has FROM other objects
- """
+ # Get all relationship types this object has FROM other objects
sID, sobj = self._uidFor(object)
brains = self._queryFor(tid=sID)
res = {}
@@ -469,12 +466,12 @@
shasattr(object, 'isReferenceable'))
def reference_url(self, object):
- """return a url to an object that will resolve by reference"""
+ # return a url to an object that will resolve by reference
sID, sobj = self._uidFor(object)
return "%s/lookupObject?uuid=%s" % (self.absolute_url(), sID)
def lookupObject(self, uuid, REQUEST=None):
- """Lookup an object by its uuid"""
+ # Lookup an object by its uuid
obj = self._objectByUUID(uuid)
if REQUEST:
return REQUEST.RESPONSE.redirect(obj.absolute_url())
@@ -604,6 +601,7 @@
+ security.declareProtected(permissions.ManagePortal, 'manage_catalogFoundItems')
def manage_catalogFoundItems(self, REQUEST, RESPONSE, URL2, URL1,
obj_metatypes=None,
obj_ids=None, obj_searchterm=None,
Modified: Products.Archetypes/trunk/Products/Archetypes/Referenceable.py
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/Referenceable.py (original)
+++ Products.Archetypes/trunk/Products/Archetypes/Referenceable.py Wed Feb 16 05:50:06 2011
@@ -35,10 +35,11 @@
implements(IReferenceable)
security = ClassSecurityInfo()
- # XXX FIXME more security
+ # Note: methods of this class are made non-publishable by not giving them
+ # docstrings.
def reference_url(self):
- """like absoluteURL, but return a link to the object with this UID"""
+ # like absoluteURL, but return a link to the object with this UID"""
tool = getToolByName(self, config.REFERENCE_CATALOG)
return tool.reference_url(self)
@@ -61,19 +62,17 @@
return tool.deleteReferences(self, relationship)
def getRelationships(self):
- """What kinds of relationships does this object have"""
+ # What kinds of relationships does this object have
tool = getToolByName(self, config.REFERENCE_CATALOG)
return tool.getRelationships(self)
def getBRelationships(self):
- """
- What kinds of relationships does this object have from others
- """
+ # What kinds of relationships does this object have from others
tool = getToolByName(self, config.REFERENCE_CATALOG)
return tool.getBackRelationships(self)
def getRefs(self, relationship=None, targetObject=None):
- """get all the referenced objects for this object"""
+ # get all the referenced objects for this object
tool = getToolByName(self, 'reference_catalog')
brains = tool.getReferences(self, relationship, targetObject=targetObject,
objects=False)
@@ -82,11 +81,11 @@
return []
def _getURL(self):
- """the url used as the relative path based uid in the catalogs"""
+ # the url used as the relative path based uid in the catalogs
return getRelURL(self, self.getPhysicalPath())
def getBRefs(self, relationship=None, targetObject=None):
- """get all the back referenced objects for this object"""
+ # get all the back referenced objects for this object
tool = getToolByName(self, 'reference_catalog')
brains = tool.getBackReferences(self, relationship,
targetObject=targetObject, objects=False)
@@ -99,7 +98,7 @@
getBackReferences=getBRefs
def getReferenceImpl(self, relationship=None, targetObject=None):
- """get all the reference objects for this object """
+ # get all the reference objects for this object
tool = getToolByName(self, config.REFERENCE_CATALOG)
refs = tool.getReferences(self, relationship, targetObject=targetObject)
if refs:
@@ -107,7 +106,7 @@
return []
def getBackReferenceImpl(self, relationship=None, targetObject=None):
- """get all the back reference objects for this object"""
+ # get all the back reference objects for this object
tool = getToolByName(self, config.REFERENCE_CATALOG)
refs = tool.getBackReferences(self, relationship, targetObject=targetObject)
if refs:
@@ -133,7 +132,7 @@
return obj
def _register(self, reference_manager=None):
- """register with the archetype tool for a unique id"""
+ # register with the archetype tool for a unique id
if IUUID(self, None) is not None:
return
@@ -143,13 +142,13 @@
def _unregister(self):
- """unregister with the archetype tool, remove all references"""
+ # unregister with the archetype tool, remove all references
reference_manager = getToolByName(self, config.REFERENCE_CATALOG)
reference_manager.unregisterObject(self)
def _getReferenceAnnotations(self):
- """given an object extract the bag of references for which it
- is the source"""
+ # given an object, extract the bag of references for which it is the
+ # source
if not getattr(aq_base(self), config.REFERENCE_ANNOTATION, None):
setattr(self, config.REFERENCE_ANNOTATION,
Folder(config.REFERENCE_ANNOTATION))
@@ -157,8 +156,7 @@
return getattr(self, config.REFERENCE_ANNOTATION).__of__(self)
def _delReferenceAnnotations(self):
- """Removes annotation from self
- """
+ # Removes annotation from self
if getattr(aq_base(self), config.REFERENCE_ANNOTATION, None):
delattr(self, config.REFERENCE_ANNOTATION)
@@ -198,8 +196,8 @@
self.manage_afterAdd(item, container)
def _updateCatalog(self, container):
- """Update catalog after copy, rename ...
- """
+ # Update catalog after copy, rename ...
+
# the UID index needs to be updated for any annotations we
# carry
try:
@@ -218,10 +216,9 @@
## OFS Hooks
def manage_afterAdd(self, item, container):
- """
- Get a UID
- (Called when the object is created or moved.)
- """
+ # Get a UID
+ # (Called when the object is created or moved.)
+
if isFactoryContained(self):
return
isCopy = getattr(item, '_v_is_cp', None)
@@ -249,10 +246,9 @@
def manage_afterClone(self, item):
- """
- Get a new UID (effectivly dropping reference)
- (Called when the object is cloned.)
- """
+ # Get a new UID (effectivly dropping reference)
+ # (Called when the object is cloned.)
+
uc = getToolByName(self, config.UID_CATALOG)
isCopy = getattr(item, '_v_is_cp', None)
@@ -275,10 +271,8 @@
self._updateCatalog(self)
def manage_beforeDelete(self, item, container):
- """
- Remove self from the catalog.
- (Called when the object is deleted or moved.)
- """
+ # Remove self from the catalog.
+ # (Called when the object is deleted or moved.)
# Change this to be "item", this is the root of this recursive
# chain and it will be flagged in the correct mode
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb