web/contentment/taxonomy.py
def _normpath(self):
		"""Recalculate the paths for all descendants of this asset."""
		
		cache = {}
		
		descendants = self.contents.order_by('path').no_dereference().only('parent', 'name')
		
		i = -1
		
		for i, child in enumerate(descendants):
			pid = str(child.parent._id)
			
			if pid not in cache:
				cache[pid] = self.tqs(id=child.parent._id).scalar('path')
			
			parent_path = cache[child.parent._id]
			
			child.update(set__path=parent_path + '/' + child.name)
		
		return i + 1
Recalculate the paths for all descendants of this asset.
Recalculate the paths for all descendants of this asset.
Recalculate the paths for all descendants of this asset .
def _normpath(self):
		cache = {}
		descendants = self.contents.order_by('path').no_dereference().only('parent', 'name')
		i = -1
		for i, child in enumerate(descendants):
			pid = str(child.parent._id)
			if pid not in cache:
				cache[pid] = self.tqs(id=child.parent._id).scalar('path')
			parent_path = cache[child.parent._id]
			child.update(set__path=parent_path + '/' + child.name)
		return i + 1
def _normpath ( self ) : cache = { } descendants = self . contents . order_by ( 'path' ) . no_dereference ( ) . only ( 'parent' , 'name' ) i = - 1 for i , child in enumerate ( descendants ) : pid = str ( child . parent . _id ) if pid not in cache : cache [ pid ] = self . tqs ( id = child . parent . _id ) . scalar ( 'path' ) parent_path = cache [ child . parent . _id ] child . update ( set__path = parent_path + '/' + child . name ) return i + 1
Recalculate the paths for all descendants of this asset.
Recalculate the paths for all descendants of this asset .
"""Recalculate the paths for all descendants of this asset."""
self