Ejemplo n.º 1
0
def do_eff(new_eff):
    if new_eff != None:
        eff = Eff(new_eff, db)
        eff.increment()
        eff.save()
        return home(current=eff)
    return home()
Ejemplo n.º 2
0
Archivo: app.py Proyecto: dfm/effapp
def give_fuck(f**k):
    """
    Increment the eff count

    Parameters
    ----------
    f**k : str
        The name of the eff to increment

    Returns
    -------
    eff : Eff
        The incremented eff object

    """
    if "f**k" not in flask.session:
        flask.session["f**k"] = {}
    try:
        flask.session["f**k"][f**k]["count"] += 1
    except KeyError:
        flask.session["f**k"][f**k] = {"count":1, "locate": False}
    flask.session.modified = True

    eff = Eff(f**k, db)
    eff.increment()

    return eff