Exemplo n.º 1
0
def add_to_session(dict, session_id=None):
    if session_id is None:
        session_id = get_session_id()
    _, data = db.get_session(session_id)#vracanje do sada odabranih podataka
    for key, value in dict.items():
        data[key] = value
    db.replace_session(session_id, data)
Exemplo n.º 2
0
def add_to_session(params):
    session_id = get_or_create_session_id()
    _, data = db.get_session(session_id)  #vracanje do sada odabranih podataka
    for subject_id in params.keys():
        if ("Godina" not in params.getvalue(subject_id)):
            data[subject_id] = params.getvalue(subject_id)
    db.replace_session(session_id, data)
Exemplo n.º 3
0
def remove_from_session(params):
    session_id = get_or_create_session_id()
    _, data = db.get_session(session_id)
    for article_id in params.keys():
        data[article_id] = data.get(article_id, 0) - 1
        if data[article_id] < 1:
            data.pop(article_id, None)
    db.replace_session(session_id, data)
Exemplo n.º 4
0
def remove_from_session(dict):
    session_id = get_session_id()
    _, data = db.get_session(session_id)
    for key in dict:
        data.pop(key, None)
    db.replace_session(session_id, data)
Exemplo n.º 5
0
def add_to_session(params):
    session_id = get_or_create_session_id()
    _, data = db.get_session(session_id)  #vracanje do sada odabranih podataka
    for article_id in params.keys():
        data[article_id] = params.getvalue(article_id)
    db.replace_session(session_id, data)