Exemplo n.º 1
0
def desks():
    import time
    from recorder.models import Card, Desk

    edit_ok, lock_id = _can_edit()

    if(edit_ok):
        #Could edit, we started edition and continuing it
        redis.expire("tmp:deskLockId", 120)
    elif(lock_id == 0):
        #No one is editing
        session['desk_edit_lock_id'] = "%s" % long(time.time() * 1000)
        redis.set("tmp:deskLockId", session['desk_edit_lock_id'])
        redis.expire("tmp:deskLockId", 120)
        edit_ok = True

    desks = []
    for card in Card.all():
        for desk in card.all_desks():
            desks.append(desk)
    ret = _default_response()
    ret['title']= u"Stanowiska"
    ret['section_title']= u"Stanowiska"
    ret['user']=current_user
    ret['desks']= desks
    ret['edit_ok']= edit_ok
    return ret
Exemplo n.º 2
0
def search_advanced():
    from recorder.models import Card, Desk
    desks = []
    for card in Card.all():
        for desk in card.all_desks():
            desks.append(desk)

    ret = _default_response()
    ret['title']=u"Wyszukiwanie zaawansowane"
    ret['section_title']=u"Wyszukiwanie zaawansowane"
    ret['desks'] = desks
    ret['recordings_table']= render_template('result-table.html', recordings = [])
    ret['num']= 0
    return ret