def get(palabro): result = db.select( "palabros", what="*, UNIX_TIMESTAMP(publish) AS unix_publish", where=sqlwhere({"palabro": palabro}) ) if result: word = result[0] word["date"] = date.fromtimestamp(word["unix_publish"]) return word else: return False
def edit(palabro, hint, description): db.update("palabros", hint=hint, description=description, where=sqlwhere({"palabro": palabro}))
def getMonthArchive(year, month): return db.select( "palabros", where=sqlwhere({"YEAR(publish)": year, "MONTH(publish)": month}) + " AND DATE(publish) <= DATE(NOW())", order="publish DESC", )