Exemple #1
0
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
Exemple #2
0
def edit(palabro, hint, description):
    db.update("palabros", hint=hint, description=description, where=sqlwhere({"palabro": palabro}))
Exemple #3
0
def getMonthArchive(year, month):
    return db.select(
        "palabros",
        where=sqlwhere({"YEAR(publish)": year, "MONTH(publish)": month}) + " AND DATE(publish) <= DATE(NOW())",
        order="publish DESC",
    )