Ejemplo n.º 1
0
    def render(self, context):
        output = self.nodelist.render(context)
        try:
            _setc2Ctx(context, self.obj, DICTJSON.fromJSON(output))
        except Exception as inst:
            milog.error("Error al convertir a JSON %s", inst)
            if settings.DEBUG:
                return "ERROR PROCESADO JSON" + output

        return ""
Ejemplo n.º 2
0
    def render(self, context):
        output = self.nodelist.render(context)
        try:
            _setc2Ctx(context, self.obj, DICTJSON.fromJSON(output))
        except Exception as inst:
            milog.error("Error al convertir a JSON %s", inst)
            if settings.DEBUG:
                return "ERROR PROCESADO JSON" + output

        return ""
Ejemplo n.º 3
0
    def yblogin_permissions_request(self, request):
        if request.method == "POST":
            return HttpResponseRedirect("/")

        reg = open(path.join(settings.PROJECT_ROOT, "config/urls.json")).read()
        oReg = DICTJSON.fromJSON(reg)
        models = {}

        for mod in oReg["models"]:
            for modelName in oReg["models"][mod]:
                acciones = factorias.FactoriaAccion.getAcciones(modelName, "I")
                models[modelName] = []
                for a in acciones:
                    models[modelName].append(a)
        # miaccion = factorias.FactoriaAccion.getAcciones("telsac", 'I')

        return render(request, "portal/permissions.html", {"models": models})
Ejemplo n.º 4
0
 def render(self, context):
     output = self.nodelist.render(context)
     try:
         obj2 = DICTJSON.fromJSON(output)
     except Exception as inst:
         milog.error("Error al convertir a JSON %s", inst)
         if settings.DEBUG:
             return "ERROR PROCESADO JSON" + output
     isquery = True
     if obj2["TIPO"] == "I" or obj2["TIPO"] == "O":
         isquery = False
     context.push()
     aux = viewsets.YBMIXINCTXtemplate.respuestapeticionCTX(
         context, obj2["APLICACION"], obj2["PREFIJO"], obj2["TEMPLATE"],
         obj2.get("QUERYSTRING", {}), obj2.get("PK", None), isquery,
         obj2.get("MODIF", None), obj2.get("PARAM", None))
     context.pop()
     return aux
Ejemplo n.º 5
0
 def render(self, context):
     output = self.nodelist.render(context)
     try:
         obj2 = DICTJSON.fromJSON(output)
     except Exception as inst:
         milog.error("Error al convertir a JSON %s", inst)
         if settings.DEBUG:
             return "ERROR PROCESADO JSON" + output
     isquery = True
     if obj2["TIPO"] == "I" or obj2["TIPO"] == "O":
         isquery = False
     context.push()
     aux = viewsets.YBMIXINCTXtemplate.respuestapeticionCTX(
         context,
         obj2["APLICACION"],
         obj2["PREFIJO"],
         obj2["TEMPLATE"],
         obj2.get("QUERYSTRING", {}),
         obj2.get("PK", None),
         isquery,
         obj2.get("MODIF", None),
     )
     context.pop()
     return aux
Ejemplo n.º 6
0
from os import path

from AQNEXT.settings import PROJECT_ROOT
from YBAQNEXT.settings import INSTALLED_APPS
from YBWEB.ctxJSON import DICTJSON

YEBO_APPS = ()
CONTROLLER_APPS = ()
API_APPS = ()

rest = open(path.join(PROJECT_ROOT, "config/urls.json")).read()
oRest = DICTJSON.fromJSON(rest)

for app in oRest:
    if "controller" in oRest[app]:
        CONTROLLER_APPS += (app, )
    elif "api" in oRest[app]:
        API_APPS += (app, )
    else:
        YEBO_APPS += (app, )

INSTALLED_APPS += YEBO_APPS
INSTALLED_APPS += CONTROLLER_APPS
INSTALLED_APPS += API_APPS
# INSTALLED_APPS += ('channels', )
Ejemplo n.º 7
0
 def test_fromJSON(self):
     str_json = '{"a": "b", "c": {"d": "e"}}'
     json = OrderedDict([('a', 'b'), ('c', OrderedDict([('d', 'e')]))])
     self.assertEqual(DICTJSON.fromJSON(str_json), json)
Ejemplo n.º 8
0
def cargaDictJSON(templatechain, requestcontext=None):
    # return DICTJSON.fromJSON("{" + cargaString(templatechain, requestcontext) + "}")
    return DICTJSON.fromJSON(cargaString(templatechain, requestcontext))