Ejemplo n.º 1
0
def show_edit_child(id):
    try:
        nice_name = inventory_viewer.get_nicename(db_name=id,
                                                  collection_name=None)
        listing = inventory_viewer.get_edit_list(id)
    except ih.ConnectOrAuthFail as e:
        linv.log_dest.error("Returning auth fail page")

        new_url = str(request.referrer)

        bread = [['⌂', url_for('index')],
                 [
                     url_pref.strip('/'),
                     url_for('inventory_app.show_edit_root')
                 ]]
        mess = "Connect or Auth failure: (" + str(
            dt.now().strftime('%d/%m/%y %H:%M:%S')) + ") " + e.message
        return render_template('edit_authfail.html',
                               new_url=new_url,
                               message=mess,
                               submit_contact=linv.email_contact,
                               bread=bread)

    return render_template(
        'edit_show_list.html',
        db_name=id,
        nice_name=nice_name,
        listing=listing,
        bread=[['⌂', url_for('index')],
               [url_pref.strip('/'),
                url_for('inventory_app.show_edit_root')],
               [id, url_for('inventory_app.show_edit_child', id=id)]])
Ejemplo n.º 2
0
def show_indices(id, id2):
    bread = [['⌂', url_for('index')],
             [url_pref.strip('/'),
              url_for('inventory_app.show_edit_root')],
             [id, url_for('inventory_app.show_edit_child', id=id)],
             [id2,
              url_for('inventory_app.show_inventory', id=id, id2=id2)],
             [
                 'indices',
                 url_for('inventory_app.show_indices', id=id, id2=id2)
             ]]
    try:
        valid = inventory_viewer.is_valid_db_collection(id, id2)
        if not valid:
            raise BadNameError('')
        nice_name = inventory_viewer.get_nicename(db_name=id,
                                                  collection_name=id2)
    except BadNameError as e:
        return render_template(
            'edit_bad_name.html',
            db_name=id,
            coll_name=id2,
            bread=[
                ['⌂', url_for('index')],
                [url_pref.strip('/'),
                 url_for('inventory_app.show_edit_root')],
                [id, url_for('inventory_app.show_edit_child', id=id)],
                [id2,
                 url_for('inventory_app.show_indices', id=id, id2=id2)]
            ])
    except ih.ConnectOrAuthFail as e:
        linv.log_dest.error("Returning auth fail page")

        new_url = str(request.referrer)

        bread = [['⌂', url_for('index')],
                 [
                     url_pref.strip('/'),
                     url_for('inventory_app.show_edit_root')
                 ]]
        mess = "Connect or Auth failure: (" + str(
            dt.now().strftime('%d/%m/%y %H:%M:%S')) + ") " + e.message
        return render_template('edit_authfail.html',
                               new_url=new_url,
                               message=mess,
                               submit_contact=linv.email_contact,
                               bread=bread)
    return render_template('view_indices.html',
                           db_name=id,
                           collection_name=id2,
                           bread=bread,
                           nice_name=nice_name,
                           index_fields=linv.index_field_order())
Ejemplo n.º 3
0
def show_edit_records(id, id2):
    try:
        valid = inventory_viewer.is_valid_db_collection(id, id2)
        if not valid:
            raise BadNameError('')
        locked = inventory_live_data.get_lockout_state()
    except BadNameError:
        return render_template('edit_bad_name.html', db_name=id, coll_name=id2, bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')],[id, url_for('inventory_app.show_edit_child', id=id)], [id2, url_for('inventory_app.show_edit_records', id=id, id2=id2)]])
    bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')], [id, url_for('inventory_app.show_edit_child', id=id)], [id2, url_for('inventory_app.show_inventory', id=id, id2=id2)], ['records', url_for('inventory_app.show_records', id=id, id2=id2)], ['edit', url_for('inventory_app.show_edit_records', id=id, id2=id2)]]
    nice_name = inventory_viewer.get_nicename(db_name = id, collection_name = id2)
    if locked:
        return render_template('edit_locked.html')
    else:
        return render_template('edit_records.html', db_name=id, collection_name=id2, type_data=linv.get_type_strings_as_json(), record_fields=linv.record_field_order(), bread=bread, nice_name =nice_name, record_noedit=linv.record_noeditable())
Ejemplo n.º 4
0
def show_records(id, id2):
    bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')], [id, url_for('inventory_app.show_edit_child', id=id)], [id2, url_for('inventory_app.show_inventory', id=id, id2=id2)], ['records', url_for('inventory_app.show_records', id=id, id2=id2)]]
    try:
        valid = inventory_viewer.is_valid_db_collection(id, id2)
        if not valid:
            raise BadNameError('')
        nice_name = inventory_viewer.get_nicename(db_name = id, collection_name = id2)
    except BadNameError as e:
        return render_template('edit_bad_name.html', db_name=id, coll_name=id2, bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')],[id, url_for('inventory_app.show_edit_child', id=id)], [id2, url_for('inventory_app.show_records', id=id, id2=id2)]])
    except ih.ConnectOrAuthFail as e:
        linv.log_dest.error("Returning auth fail page")
        new_url = str(request.referrer)
        bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')]]
        mess = "Connect or Auth failure: ("+str(dt.now().strftime('%d/%m/%y %H:%M:%S'))+") "+e.message
        return render_template('edit_authfail.html', new_url=new_url, message = mess, submit_contact=linv.email_contact, bread=bread)
    return render_template('view_records.html', db_name=id, collection_name=id2, bread=bread, record_fields=linv.record_field_order(), nice_name=nice_name)
Ejemplo n.º 5
0
def show_edit_records(id, id2):
    try:
        valid = inventory_viewer.is_valid_db_collection(id, id2)
        if not valid:
            raise BadNameError('')
        locked = inventory_live_data.get_lockout_state()
    except BadNameError:
        return render_template(
            'edit_bad_name.html',
            db_name=id,
            coll_name=id2,
            bread=[['⌂', url_for('index')],
                   [
                       url_pref.strip('/'),
                       url_for('inventory_app.show_edit_root')
                   ], [id, url_for('inventory_app.show_edit_child', id=id)],
                   [
                       id2,
                       url_for('inventory_app.show_edit_records',
                               id=id,
                               id2=id2)
                   ]])
    bread = [
        ['⌂', url_for('index')],
        [url_pref.strip('/'),
         url_for('inventory_app.show_edit_root')],
        [id, url_for('inventory_app.show_edit_child', id=id)],
        [id2, url_for('inventory_app.show_inventory', id=id, id2=id2)],
        ['records',
         url_for('inventory_app.show_records', id=id, id2=id2)],
        ['edit',
         url_for('inventory_app.show_edit_records', id=id, id2=id2)]
    ]
    nice_name = inventory_viewer.get_nicename(db_name=id, collection_name=id2)
    if locked:
        return render_template('edit_locked.html')
    else:
        return render_template('edit_records.html',
                               db_name=id,
                               collection_name=id2,
                               type_data=linv.get_type_strings_as_json(),
                               record_fields=linv.record_field_order(),
                               bread=bread,
                               nice_name=nice_name,
                               record_noedit=linv.record_noeditable())
Ejemplo n.º 6
0
def show_edit_child(id):
    try:
        valid = inventory_viewer.is_valid_db(id)
        if not valid:
            raise BadNameError('')
        nice_name = inventory_viewer.get_nicename(db_name = id, table_name = None)
        listing = inventory_viewer.retrieve_db_listing(id)
        lockout = inventory_live_data.get_lockout_state()
    except BadNameError as e:
        return render_template('edit_bad_name.html', db_name=id, table_name=None, bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')],[id, url_for('inventory_app.show_edit_child', id=id)]])
    except ih.ConnectOrAuthFail as e:
        linv.log_dest.error("Returning auth fail page")
        new_url = str(request.referrer)
        bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')]]
        mess = "Connect or Auth failure: ("+str(dt.now().strftime('%d/%m/%y %H:%M:%S'))+") "+e.message
        return render_template('edit_authfail.html', new_url=new_url, message = mess, submit_contact=linv.email_contact, bread=bread)

    return render_template('edit_show_list.html', db_name=id, nice_name=nice_name, listing=listing, lockout=lockout, bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')],[id, url_for('inventory_app.show_edit_child', id=id)]])
Ejemplo n.º 7
0
def show_edit_child(id):
    try:
        valid = inventory_viewer.is_valid_db(id)
        if not valid:
            raise BadNameError('')
        nice_name = inventory_viewer.get_nicename(db_name=id, table_name=None)
        listing = inventory_viewer.retrieve_db_listing(id)
        lockout = inventory_live_data.get_lockout_state()
    except BadNameError as e:
        return render_template(
            'edit_bad_name.html',
            db_name=id,
            table_name=None,
            bread=[['⌂', url_for('index')],
                   [
                       url_pref.strip('/'),
                       url_for('inventory_app.show_edit_root')
                   ], [id, url_for('inventory_app.show_edit_child', id=id)]])
    except ih.ConnectOrAuthFail as e:
        linv.log_dest.error("Returning auth fail page")
        new_url = str(request.referrer)
        bread = [['⌂', url_for('index')],
                 [
                     url_pref.strip('/'),
                     url_for('inventory_app.show_edit_root')
                 ]]
        mess = "Connect or Auth failure: (" + str(
            dt.now().strftime('%d/%m/%y %H:%M:%S')) + ") " + e.message
        return render_template('edit_authfail.html',
                               new_url=new_url,
                               message=mess,
                               submit_contact=linv.email_contact,
                               bread=bread)

    return render_template(
        'edit_show_list.html',
        db_name=id,
        nice_name=nice_name,
        listing=listing,
        lockout=lockout,
        bread=[['⌂', url_for('index')],
               [url_pref.strip('/'),
                url_for('inventory_app.show_edit_root')],
               [id, url_for('inventory_app.show_edit_child', id=id)]])
Ejemplo n.º 8
0
def show_edit_records(id, id2):
    bread = [
        ['⌂', url_for('index')],
        [url_pref.strip('/'),
         url_for('inventory_app.show_edit_root')],
        [id, url_for('inventory_app.show_edit_child', id=id)],
        [id2, url_for('inventory_app.show_inventory', id=id, id2=id2)],
        ['records',
         url_for('inventory_app.show_records', id=id, id2=id2)],
        ['edit',
         url_for('inventory_app.show_edit_records', id=id, id2=id2)]
    ]
    nice_name = inventory_viewer.get_nicename(db_name=id, collection_name=id2)
    return render_template('edit_records.html',
                           db_name=id,
                           collection_name=id2,
                           type_data=linv.get_type_strings_as_json(),
                           record_fields=linv.record_field_order(),
                           bread=bread,
                           nice_name=nice_name,
                           record_noedit=linv.record_noeditable())