Esempio n. 1
0
def elements_timeperiod(name):
    user = app.get_user_auth()
    if not user:
        redirect("/user/login")

    elt = app.datamgr.get_timeperiod(name)
    if not elt:
        elt = {}
    return {'app': app, 'user': user, 'elt': elt, 'helper': Helper(app)}
Esempio n. 2
0
def elements_host(name):
    user = app.get_user_auth()
    if not user:
        redirect("/user/login")

    #elt = app.db.hosts.find_one({'_id': name})
    elt = app.datamgr.get_host(name)
    if not elt:
        elt = {}
    return {'app': app, 'user': user, 'elt': elt, 'helper': Helper(app)}
Esempio n. 3
0
def new_object():
    user = app.get_user_auth()
    if not user:
        redirect("/user/login")

    return {'app': app, 'user': user, 'elt': {}, 'helper': Helper(app)}