def findAll(self,order='dataInserimento',type='asc'):
logging.debug("Chiamato find all")
sql = """select id,nickname,email,messaggio,dataInserimento
from dedica order by %s %s""" % (order,type)
conn = MySQLdb.connect(host=self.__host__, user=self.__user__, passwd=self.__passwd__, db=self.__db__)
rows=None
cursor = conn.cursor()
try:
cursor.execute(sql)
rows = cursor.fetchall()
cursor.close()
conn.commit()
except Exception as e:
conn.rollback()
logging.error("Unexpected error:"+ e)
logging.debug("rollback")
conn.close()
return self.__rowsToDediche__(rows)