web/contentment/taxonomy.py
def detach(self, path=True):
		"""Detach this asset from its current taxonomy."""
		
		obj = self.clone().first()
		
		if obj.path in (None, '', obj.name):
			return obj
		
		log.warn("Detaching from taxonomy.", extra=dict(asset=repr(obj), path=path))
		
		self.nextAll.update(inc__order=-1)
		self.contents.update(pull_all__parents=obj.parents)
		
		obj.order = None
		obj.path = obj.name
		obj.parent = None
		obj.parents.clear()  # We can't use `del obj.parents[:]` because MongoEngine detects that.
		obj.save()
		
		if path:
			obj._normpath()
		
		return obj
Detach this asset from its current taxonomy.
Detach this asset from its current taxonomy.
Detach this asset from its current taxonomy .
def detach(self, path=True):
		obj = self.clone().first()
		if obj.path in (None, '', obj.name):
			return obj
		log.warn("Detaching from taxonomy.", extra=dict(asset=repr(obj), path=path))
		self.nextAll.update(inc__order=-1)
		self.contents.update(pull_all__parents=obj.parents)
		obj.order = None
		obj.path = obj.name
		obj.parent = None
		obj.parents.clear()  
		obj.save()
		if path:
			obj._normpath()
		return obj
def detach ( self , path = True ) : obj = self . clone ( ) . first ( ) if obj . path in ( None , '' , obj . name ) : return obj log . warn ( "Detaching from taxonomy." , extra = dict ( asset = repr ( obj ) , path = path ) ) self . nextAll . update ( inc__order = - 1 ) self . contents . update ( pull_all__parents = obj . parents ) obj . order = None obj . path = obj . name obj . parent = None obj . parents . clear ( ) obj . save ( ) if path : obj . _normpath ( ) return obj
Detach this asset from its current taxonomy.
Detach this asset from its current taxonomy .
"""Detach this asset from its current taxonomy.""" # We can't use `del obj.parents[:]` because MongoEngine detects that.
self
path