Пример #1
0
def get_form(tabla, metodo):
    dict_out["tabla"] = tabla
    dict_out["metodo"] = metodo

    campos = []
    for r in db.get_cursor_description(tabla):
        campo = {}
        campo['nombre'] = r['nombre']
        campo['tipo'] = r['tipo'].replace('VAR_','').lower()

        if 'NOT_NULL' in r['flags']:
            campo['required'] = 'required'

        if 'PRI_KEY' in r['flags']:
            campo['hidden'] = "hidden"
        
        if 'MULTIPLE_KEY' in r['flags']:
            fktabla = r['nombre'].replace('id','',1)
            campo['fktabla'] = fktabla
            campo['data'] = db.get_combo_data(fktabla)

        campos.append(campo)
    dict_out["campos"] = campos
  

    return dict_out
Пример #2
0
def provincias():
    return db.get_data('getProvincia', -1)
Пример #3
0
import modulos.monitor as monitor
import modulos.Config as cfg
import modulos.Database as db
from flask import Flask, render_template
import json

app = Flask(__name__)

cfg.init(app)

monitor.cfg = app.config
db.cfg = app.config
db.create_pool()
monitor.db = db


@app.route('/')
def index():
    return render_template('index.html', data={})


@app.route('/favicon.ico')
def favico():
    return 'OK'


@app.errorhandler(404)
def not_found(e):
    # defining function
    return render_template("404.html")
Пример #4
0
def testDepartamento():
    print(db2.get_data('getDeptPcia', 1))
Пример #5
0
def testTipoNivelEducacion():
    print(db2.get_data('getTipoNivelEducacion', -1))
Пример #6
0
def testAmbito():
    print(db2.get_data('getAmbito', -1))
Пример #7
0
def testVersion():
    print(db2.get_version())
Пример #8
0
def localidad(id):
    return db.get_data('getLocalId', id)
Пример #9
0
def tipoeducacion(id):
    return db.get_data('getTipoEducacion', id)
Пример #10
0
def tiposeducacion():
    return db.get_data('getTipoEducacion', -1)
Пример #11
0
def ambito(id):
    return db.get_data('getAmbito', id)
Пример #12
0
def ambitos():
    return db.get_data('getAmbito', -1)
Пример #13
0
def sector(id):
    return db.get_data('getSector', id)
Пример #14
0
def sectores():
    return db.get_data('getSector', -1)
Пример #15
0
def provincia(id):
    return db.get_data('getProvincia', id)
Пример #16
0
def localidades(id):
    return db.get_data('getLocalPcia',id)
Пример #17
0
def localidadesxdepto(id):
    return db.get_data('getXDepto',id) 
Пример #18
0
def niveleseducacion():
    return db.get_data('getNivelEducacion', -1)
Пример #19
0
def departamentos(id):
    return db.get_data('getDeptPcia', id)
Пример #20
0
def niveleducacion(id):
    return db.get_data('getNivelEducacion', id)
Пример #21
0
def testProvincia():
    print(db2.get_data('getProvincia', -1))
    print(db2.get_data('getProvincia', 24))
Пример #22
0
def tiposniveleseducacion():
    return db.get_data('getTipoNivelEducacion', -1)
Пример #23
0
def testSector():
    print(db2.get_data('getSector', -1))
Пример #24
0
def tiponiveleseducacion(id):
    return db.get_data('getTipoNivelEducacion', id)
Пример #25
0
def testLocalidad():
    print(db2.get_data('getLocalPcia', 23))
Пример #26
0
def escuelasxlocalidad(id):
    return db.get_data('getEscuelasXLoc', id)
Пример #27
0
def testEscuela():
    es = '"escuela" : ' + db2.get_data('getEscuelaXId', 10404)
    te = '"ted" : ' + db2.get_data('getEducEscuela', 10404)
    print('{' + es + ',' + te + '}')
Пример #28
0
def escuelaxid(id):
    es = '{ "escuela" : ' + db.get_data('getEscuelaXId',id) 
    te = ', "ted" : ' + db.get_data('getEducEscuela', id) + '}'
    return (es + te) 
Пример #29
0
def tedescuelas(id):
    return db.get_data('getEducEscuela', id) 
Пример #30
0
def version():
    return db.get_version()