M1-Arborator-NaijaSUD/arborator/lib/database.py
def removeTreesInTextByUser(self, textid, user):
		"""
		Useful to remove all tree by a certain user in a specific text

		@args:
		- numeric id of the text
		- string of the username
		"""

		db,cursor=self.open()
		q="""select trees.rowid as treeid, sentences.nr as sentencenr, users.user as username
			from trees, sentences, users
			where users.rowid = trees.userid and trees.sentenceid=sentences.rowid and sentences.textid={};""".format(textid)
		rc=cursor.execute(q)
		for treeid, sentencenr, username in rc:
			print treeid, sentencenr, username
			if username == user:
				self.eraseTree(treeid, sentencenr, username, 5)
				print "erased"

		db.commit()
		db.close()

		Useful to remove all tree by a certain user in a specific text

		@args:
		- numeric id of the text
		- string of the username
		
Useful to remove all tree by a certain user in a specific text
Useful to remove all tree by a certain user in a specific text
def removeTreesInTextByUser(self, textid, user):
		db,cursor=self.open()
		q="""select trees.rowid as treeid, sentences.nr as sentencenr, users.user as username
			from trees, sentences, users
			where users.rowid = trees.userid and trees.sentenceid=sentences.rowid and sentences.textid={};""".format(textid)
		rc=cursor.execute(q)
		for treeid, sentencenr, username in rc:
			print treeid, sentencenr, username
			if username == user:
				self.eraseTree(treeid, sentencenr, username, 5)
				print "erased"
		db.commit()
		db.close()
def removeTreesInTextByUser ( self , textid , user ) : db , cursor = self . open ( ) q = """select trees.rowid as treeid, sentences.nr as sentencenr, users.user as username
			from trees, sentences, users
			where users.rowid = trees.userid and trees.sentenceid=sentences.rowid and sentences.textid={};""" . format ( textid ) rc = cursor . execute ( q ) for treeid , sentencenr , username in rc : print treeid , sentencenr , username if username == user : self . eraseTree ( treeid , sentencenr , username , 5 ) print "erased" db . commit ( ) db . close ( )
Useful to remove all tree by a certain user in a specific text
Useful to remove all tree by a certain user in a specific text
"""
		Useful to remove all tree by a certain user in a specific text

		@args:
		- numeric id of the text
		- string of the username
		"""
self
textid
user
args
numeric id of the text
string of the username
numeric id of the text string of the username