Esempio n. 1
0
class trainb_problem(interna_problem):

    idproblem = baseraw.AutoField(
        db_column="idproblem",
        verbose_name=FLUtil.translate(u"Identificador", u"MetaData"),
        primary_key=True
    )

    description = baseraw.TextField(
        db_column="description",
        verbose_name=FLUtil.translate(u"Descripción", u"MetaData"),
        blank=False,
        null=False
    )

    improvement = baseraw.ForeignKey(
        "improvement",
        db_column="improvement",
        verbose_name=FLUtil.translate(u"Mejora", u"MetaData"),
        blank=False,
        null=False,
        to_field="idimprovement",
        on_delete=baseraw.PROTECT,
        related_name="problems"
    )

    class Meta:
        abstract = True
Esempio n. 2
0
class trainb_action(interna_action):

    idaction = baseraw.AutoField(db_column="idaction",
                                 verbose_name=FLUtil.translate(
                                     u"Identificador", u"MetaData"),
                                 primary_key=True)

    description = baseraw.TextField(db_column="description",
                                    verbose_name=FLUtil.translate(
                                        u"Descripción", u"MetaData"),
                                    blank=False,
                                    null=False)

    state = baseraw.CharField(db_column="state",
                              verbose_name=FLUtil.translate(
                                  u"Estado", u"MetaData"),
                              blank=False,
                              null=False,
                              max_length=100,
                              unique=False)

    improvement = baseraw.ForeignKey("improvement",
                                     db_column="improvement",
                                     verbose_name=FLUtil.translate(
                                         u"Mejora", u"MetaData"),
                                     blank=False,
                                     null=False,
                                     to_field="idimprovement",
                                     on_delete=baseraw.PROTECT,
                                     related_name="actions")

    class Meta:
        abstract = True
Esempio n. 3
0
class mtd_aqn_modulescompanies(models.Model, BaseModel):
    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              u"Código", u"MetaData"),
                          primary_key=True,
                          blank=False)._miextend(REQUIRED=True,
                                                 visiblegrid=False,
                                                 OLDTIPO="SERIAL")
    idcompany = models.ForeignKey(
        "mtd_aqn_companies",
        db_column="idcompany",
        verbose_name=FLUtil.translate(u"Compañia", u"MetaData"),
        blank=True,
        null=True,
        to_field="idcompany",
        on_delete=FLUtil.deleteCascade,
        related_name=
        "aqn_modulescompanies_idcompany__fk__aqn_companies_idcompany"
    )._miextend(visiblegrid=False, OLDTIPO="UINT")
    idmodule = models.ForeignKey(
        "mtd_aqn_modules",
        db_column="idmodule",
        verbose_name=FLUtil.translate(u"Modulo", u"MetaData"),
        blank=True,
        null=True,
        to_field="idmodule",
        on_delete=FLUtil.deleteCascade,
        related_name="aqn_modulescompanies_idmodule__fk__aqn_modules_idmodule"
    )._miextend(visiblegrid=False, OLDTIPO="UINT")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate(u"Modulos compañia", u"MetaData")
        db_table = u"aqn_modulescompanies"
Esempio n. 4
0
class mtd_yb_clientessincro(models.Model, BaseModel):

    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              "MetaData", "Identificador"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    cliente = models.CharField(db_column="cliente",
                               verbose_name=FLUtil.translate(
                                   "MetaData", "Cliente"),
                               max_length=100,
                               unique=True)._miextend(OLDTIPO="STRING")
    descripcion = models.CharField(db_column="descripcion",
                                   verbose_name=FLUtil.translate(
                                       "MetaData", "Descripción"),
                                   max_length=100)._miextend(OLDTIPO="STRING")
    url = models.TextField(db_column="url",
                           verbose_name=FLUtil.translate("MetaData", "URL"),
                           max_length=250)._miextend(OLDTIPO="STRING")
    test_url = models.TextField(db_column="test_url",
                                verbose_name=FLUtil.translate(
                                    "MetaData", "TEST URL"),
                                max_length=250)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData",
                                        "Clientes de sincronización")
        db_table = u"yb_clientessincro"
Esempio n. 5
0
class mtd_aqn_modules(models.Model, BaseModel):
    idmodule = models.AutoField(db_column="idmodule",
                                verbose_name=FLUtil.translate(
                                    u"Código", u"MetaData"),
                                primary_key=True,
                                blank=False)._miextend(REQUIRED=True,
                                                       visiblegrid=False,
                                                       OLDTIPO="SERIAL")
    nombre = models.CharField(db_column="nombre",
                              verbose_name=FLUtil.translate(
                                  u"Nombre proyecto", u"MetaData"),
                              blank=False,
                              null=True,
                              max_length=50)._miextend(REQUIRED=True,
                                                       OLDTIPO="STRING")
    descripcion = models.CharField(db_column="descripcion",
                                   verbose_name=FLUtil.translate(
                                       u"Descripción", u"MetaData"),
                                   blank=True,
                                   null=True,
                                   max_length=200)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate(u"Modulos", u"MetaData")
        db_table = u"aqn_modules"
Esempio n. 6
0
class mtd_yb_subregdiagnosis(models.Model, BaseModel):
    _YB_LEGACY = True
    idsubreg = models.AutoField(db_column="idsubreg",
                                verbose_name=FLUtil.translate(
                                    "MetaData", "Identificador"),
                                primary_key=True)._miextend(visiblegrid=False,
                                                            OLDTIPO="SERIAL")
    idreg = models.IntegerField(db_column="idreg",
                                verbose_name=FLUtil.translate(
                                    "MetaData",
                                    "Registro"))._miextend(OLDTIPO="UINT")
    destino = models.CharField(db_column="destino",
                               verbose_name=FLUtil.translate(
                                   "MetaData", "Destino"),
                               max_length=50)._miextend(OLDTIPO="STRING")
    timestamp = models.CharField(db_column="timestamp",
                                 verbose_name=FLUtil.translate(
                                     "MetaData", "Ult.Sincro"),
                                 max_length=50)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData",
                                        "Subregistros de diagnosis")
        db_table = u"yb_subregdiagnosis"
Esempio n. 7
0
class mtd_sis_acl(models.Model, BaseModel):
    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              u"Identificador", u"MetaData"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    usuario = models.CharField(blank=True, null=True,
                               max_length=20)._miextend(OLDTIPO="STRING")
    grupo = models.TextField(blank=True, null=True)._miextend(OLDTIPO="STRING")
    tipo = models.CharField(
        db_column="tipo",
        verbose_name=FLUtil.translate(u"Tipo", u"MetaData"),
        default=u"tabla",
        max_length=10)._miextend(optionslist=u"tabla,accion,app",
                                 OLDTIPO="STRING")
    valor = models.CharField(blank=True, null=True,
                             max_length=50)._miextend(OLDTIPO="STRING")
    # app = models.CharField(db_column="app", verbose_name="app", blank=True, null=True, max_length=50)._miextend(OLDTIPO="STRING")
    permiso = models.CharField(blank=True, null=True,
                               max_length=2)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate(u"Control de acceso", u"MetaData")
        db_table = 'sis_acl'
Esempio n. 8
0
class trainb_comment(interna_comment):

    idcomment = baseraw.AutoField(db_column="idcomment",
                                  verbose_name=FLUtil.translate(
                                      u"Identificador", u"MetaData"),
                                  primary_key=True)._miextend(
                                      REQUIRED=True,
                                      OLDTIPO="SERIAL",
                                      visiblegrid=False,
                                  )
    description = baseraw.TextField(
        db_column="description",
        verbose_name=FLUtil.translate(u"Descripcion", u"MetaData"),
        blank=False,
        null=True,
    )
    date = baseraw.DateTimeField(db_column="date",
                                 verbose_name=FLUtil.translate(
                                     u"Fecha y hora", u"MetaData"),
                                 blank=True,
                                 default=datetime.now)
    task = baseraw.ForeignKey("task",
                              db_column="idtask",
                              verbose_name=FLUtil.translate(
                                  u"Tarea", u"MetaData"),
                              blank=False,
                              null=False,
                              max_length=30,
                              to_field="idtask",
                              on_delete=baseraw.PROTECT,
                              related_name="comments")
    user = baseraw.ForeignKey("user",
                              db_column="iduser",
                              verbose_name=FLUtil.translate(
                                  u"Líder del cambio", u"MetaData"),
                              blank=False,
                              null=False,
                              max_length=30,
                              to_field="iduser",
                              on_delete=baseraw.PROTECT,
                              related_name="user")

    def create(self, data):
        data["task"] = Task().load({"idtask": data["task"]})
        data["user"] = User().load({"iduser": data["user"]})
        return super().create(data)

    def update(self, data):
        if "task" in data:
            del data["task"]
        if "user" in data:
            del data["user"]
        return super().update(data)

    def get_projects(self):
        return self.projects.all()

    class Meta:
        abstract = True
Esempio n. 9
0
class mtd_ac_usuarios(models.Model, BaseModel):
    idusuario = models.AutoField(db_column="idusuario", verbose_name=FLUtil.translate("MetaData", "Identificador"), primary_key=True)._miextend(visiblegrid=False, OLDTIPO="SERIAL")
    nombre = models.CharField(blank=False, null=True, max_length=100)._miextend(OLDTIPO="STRING")
    password = models.TextField(blank=False, null=True)._miextend(OLDTIPO="STRING")
    esadmin = models.NullBooleanField(db_column="esadmin", verbose_name=FLUtil.translate("MetaData", "Admin"), default=False, null=True)._miextend(OLDTIPO="BOOL")
    codfuncional = models.CharField(blank=True, null=True, max_length=15)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData", "Usuarios area clientes")
        db_table = 'ac_usuarios'
Esempio n. 10
0
class mtd_yb_procesos_erroneos(models.Model, BaseModel):

    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              "MetaData", "Identificador"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    cliente = models.ForeignKey(
        "mtd_yb_clientessincro",
        db_column="cliente",
        verbose_name=FLUtil.translate("MetaData", "Cliente"),
        max_length=100,
        to_field="cliente",
        related_name=
        "yb_procesos_erroneos_cliente__fk__yb_clientessincro_cliente"
    )._miextend(OLDTIPO="STRING")
    grupoprocesos = models.ForeignKey(
        "mtd_yb_gruposprocesos",
        db_column="grupoprocesos",
        verbose_name=FLUtil.translate("MetaData", "Grupo de procesos"),
        max_length=100,
        to_field="codigo",
        related_name=
        "yb_procesos_erroneos_grupoprocesos__fk__yb_gruposprocesos_codigo"
    )._miextend(OLDTIPO="STRING")
    proceso = models.CharField(db_column="proceso",
                               verbose_name=FLUtil.translate(
                                   "MetaData", "Proceso"),
                               max_length=100)._miextend(OLDTIPO="STRING")
    error = models.TextField(db_column="error",
                             verbose_name=FLUtil.translate(
                                 "MetaData",
                                 "Error"))._miextend(OLDTIPO="STRING")
    codregistro = models.CharField(db_column="codregistro",
                                   verbose_name=FLUtil.translate(
                                       "MetaData", "Cod. Registro"),
                                   max_length=100)._miextend(OLDTIPO="STRING")
    resuelto = models.BooleanField(db_column="resuelto",
                                   verbose_name=FLUtil.translate(
                                       "MetaData", "Resuelto"),
                                   default=False,
                                   null=False)._miextend(OLDTIPO="BOOL")
    timestamp = models.CharField(db_column="timestamp",
                                 verbose_name=FLUtil.translate(
                                     "MetaData", "Ult.Sincro"),
                                 max_length=50)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData", "Procesos erróneos")
        db_table = u"yb_procesos_erroneos"
Esempio n. 11
0
class mtd_auth_group(models.Model, BaseModel):
    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              u"Identificador", u"MetaData"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    name = models.CharField(unique=True,
                            max_length=80)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = False
        verbose_name = "Grupos"
        db_table = 'auth_group'
Esempio n. 12
0
class trainb_consultant(interna_consultant):

    idconsultant = baseraw.AutoField(db_column="idconsultant",
                                     verbose_name=FLUtil.translate(
                                         u"Identificador", u"MetaData"),
                                     primary_key=True)._miextend(
                                         REQUIRED=True,
                                         OLDTIPO="SERIAL",
                                         visiblegrid=False,
                                     )

    def get_projects(self):
        return self.projects.all()

    class Meta:
        abstract = True
Esempio n. 13
0
class mtd_aqn_invitations(models.Model, BaseModel):
    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              u"Identificador", u"MetaData"),
                          primary_key=True,
                          blank=False)._miextend(REQUIRED=True,
                                                 visiblegrid=False,
                                                 OLDTIPO="SERIAL")
    email = models.CharField(max_length=254)._miextend(OLDTIPO="STRING")
    hashcode = models.CharField(db_column="hashcode",
                                verbose_name=FLUtil.translate(
                                    u"Hashcode", u"MetaData"),
                                blank=True,
                                null=True,
                                max_length=200)._miextend(OLDTIPO="STRING")
    idcompany = models.ForeignKey(
        "mtd_aqn_companies",
        db_column="idcompany",
        verbose_name=FLUtil.translate(u"Compañia", u"MetaData"),
        blank=True,
        null=True,
        to_field="idcompany",
        on_delete=FLUtil.deleteCascade,
        related_name="aqn_invitations_idcompany__fk__aqn_companies_idcompany"
    )._miextend(visiblegrid=False, OLDTIPO="UINT")
    fecha = models.DateTimeField()._miextend(OLDTIPO="DATE")
    activo = models.BooleanField()._miextend(OLDTIPO="BOOL")
    codproyecto = models.CharField(db_column="codproyecto",
                                   verbose_name=FLUtil.translate(
                                       u"Proyecto", u"MetaData"),
                                   blank=False,
                                   null=True,
                                   max_length=15)._miextend(REQUIRED=True,
                                                            OLDTIPO="STRING")
    # codproyecto = models.ForeignKey("mtd_gt_proyectos", db_column="codproyecto", verbose_name=FLUtil.translate(u"Proyecto", u"MetaData"), blank=False, null=True, max_length=15, to_field="codproyecto", on_delete=FLUtil.deleteCascade, related_name="aqn_invitations_codproyecto__fk__gt_proyectos_codproyecto")._miextend(REQUIRED=True, OLDTIPO="STRING")
    idproyecto = models.IntegerField(db_column="idproyecto",
                                     verbose_name=FLUtil.translate(
                                         u"Proyecto", u"MetaData"),
                                     blank=True,
                                     null=True)._miextend(visiblegrid=False,
                                                          OLDTIPO="UINT")
    tipo = models.CharField(db_column="tipo",
                            verbose_name=FLUtil.translate(
                                u"Tipo", u"MetaData"),
                            blank=True,
                            null=True,
                            max_length=50)._miextend(OLDTIPO="STRING")
    caducidad = models.DateTimeField(blank=True,
                                     null=True)._miextend(OLDTIPO="DATE")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate(u"Invitaciones", u"MetaData")
        db_table = u"aqn_invitations"
Esempio n. 14
0
class trainb_address(interna_address):

    idaddress = baseraw.AutoField(db_column="idaddress",
                                  verbose_name=FLUtil.translate(
                                      u"Identificador", u"MetaData"),
                                  primary_key=True)._miextend(
                                      REQUIRED=True,
                                      OLDTIPO="SERIAL",
                                      visiblegrid=False,
                                  )
    description = baseraw.CharField(db_column="description",
                                    verbose_name=FLUtil.translate(
                                        u"Descripcion", u"MetaData"),
                                    blank=False,
                                    null=False,
                                    max_length=140)._miextend(OLDTIPO="STRING")
    street_address = baseraw.CharField(
        db_column="street_address",
        verbose_name=FLUtil.translate(u"Dirección", u"MetaData"),
        blank=False,
        null=False,
        max_length=100)._miextend(OLDTIPO="STRING")
    city = baseraw.CharField(db_column="city",
                             verbose_name=FLUtil.translate(
                                 u"Ciudad", u"MetaData"),
                             blank=False,
                             null=False,
                             max_length=100)._miextend(OLDTIPO="STRING")
    country = baseraw.CharField(db_column="country",
                                verbose_name=FLUtil.translate(
                                    u"País", u"MetaData"),
                                blank=False,
                                null=False,
                                max_length=100)._miextend(OLDTIPO="STRING")
    postal_code = baseraw.CharField(db_column="postal_code",
                                    verbose_name=FLUtil.translate(
                                        u"Código postal", u"MetaData"),
                                    blank=False,
                                    null=False,
                                    max_length=10)._miextend(OLDTIPO="STRING")

    def getName(self):
        return self.name

    class Meta:
        abstract = True
Esempio n. 15
0
class mtd_auth_user(models.Model, BaseModel):
    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              u"Identificador", u"MetaData"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    password = models.CharField(max_length=128)._miextend(OLDTIPO="STRING")
    last_login = models.DateTimeField(blank=True,
                                      null=True)._miextend(OLDTIPO="DATE")
    is_superuser = models.BooleanField()._miextend(OLDTIPO="BOOL")
    username = models.CharField(unique=True,
                                max_length=30)._miextend(OLDTIPO="STRING")
    first_name = models.CharField(max_length=30)._miextend(OLDTIPO="STRING")
    last_name = models.CharField(max_length=30)._miextend(OLDTIPO="STRING")
    email = models.CharField(max_length=254)._miextend(OLDTIPO="STRING")
    is_staff = models.BooleanField()._miextend(OLDTIPO="BOOL")
    is_active = models.BooleanField()._miextend(OLDTIPO="BOOL")
    date_joined = models.DateTimeField()._miextend(OLDTIPO="DATE")

    class Meta:
        managed = False
        verbose_name = "Usuarios"
        db_table = 'auth_user'
Esempio n. 16
0
class mtd_yb_gruposprocesos(models.Model, BaseModel):

    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              "MetaData", "Identificador"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    codigo = models.TextField(db_column="codigo",
                              verbose_name=FLUtil.translate(
                                  "MetaData", "codigo"),
                              max_length=200,
                              unique=True)._miextend(OLDTIPO="STRING")
    descripcion = models.CharField(db_column="descripcion",
                                   verbose_name=FLUtil.translate(
                                       "MetaData", "Descripción"),
                                   max_length=100)._miextend(OLDTIPO="STRING")
    cliente = models.ForeignKey(
        "mtd_yb_clientessincro",
        db_column="cliente",
        verbose_name=FLUtil.translate("MetaData", "Cliente"),
        max_length=100,
        to_field="cliente",
        related_name="yb_gruposprocesos_cliente__fk__yb_clientessincro_cliente"
    )._miextend(OLDTIPO="STRING")
    prefijo = models.TextField(db_column="prefijo",
                               verbose_name=FLUtil.translate(
                                   "MetaData", "Prefijo"),
                               max_length=100)._miextend(OLDTIPO="STRING")
    icon = models.TextField(db_column="icon",
                            verbose_name=FLUtil.translate("MetaData", "Icono"),
                            max_length=100)._miextend(OLDTIPO="STRING")
    rgb = models.TextField(db_column="rgb",
                           verbose_name=FLUtil.translate("MetaData", "RGB"),
                           max_length=100)._miextend(OLDTIPO="STRING")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData", "Grupos de procesos")
        db_table = u"yb_gruposprocesos"
Esempio n. 17
0
class mtd_yb_log(models.Model, BaseModel):

    id = models.AutoField(db_column="id",
                          verbose_name=FLUtil.translate(
                              "MetaData", "Identificador"),
                          primary_key=True)._miextend(visiblegrid=False,
                                                      OLDTIPO="SERIAL")
    cliente = models.ForeignKey(
        "mtd_yb_clientessincro",
        db_column="cliente",
        verbose_name=FLUtil.translate("MetaData", "Cliente"),
        max_length=100,
        to_field="cliente",
        related_name="yb_log_cliente__fk__yb_clientessincro_cliente"
    )._miextend(OLDTIPO="STRING")
    grupoprocesos = models.ForeignKey(
        "mtd_yb_gruposprocesos",
        db_column="grupoprocesos",
        verbose_name=FLUtil.translate("MetaData", "Grupo de procesos"),
        max_length=100,
        to_field="codigo",
        related_name="yb_log_grupoprocesos__fk__yb_gruposprocesos_codigo"
    )._miextend(OLDTIPO="STRING")
    tipo = models.CharField(db_column="tipo",
                            verbose_name=FLUtil.translate("MetaData", "Tipo"),
                            max_length=100)._miextend(OLDTIPO="STRING")
    texto = models.TextField(db_column="texto",
                             verbose_name=FLUtil.translate(
                                 "MetaData",
                                 "Log"))._miextend(OLDTIPO="STRING")
    timestamp = models.DateTimeField(
        db_column="timestamp",
        verbose_name=FLUtil.translate("MetaData",
                                      "Ult.Sincro"))._miextend(OLDTIPO="DATE")

    class Meta:
        managed = True
        verbose_name = FLUtil.translate("MetaData", "Registros de logs")
        db_table = u"yb_log"
Esempio n. 18
0
class trainb_sprint(interna_sprint):

    idsprint = baseraw.AutoField(
        db_column="idsprint",
        verbose_name=FLUtil.translate(u"Identificador", u"MetaData"),
        primary_key=True
    )._miextend(
        REQUIRED=True,
        OLDTIPO="SERIAL",
        visiblegrid=False,
    )
    objective = baseraw.TextField(
        db_column="objective",
        verbose_name=FLUtil.translate(u"Definición de hecho", u"MetaData"),
        blank=True,
        null=True
    )._miextend(
        OLDTIPO="STRING"
    )
    cost = baseraw.FloatField(
        db_column="cost",
        verbose_name=FLUtil.translate(u"Coste", u"MetaData"),
        blank=True,
        null=True,
        default=None
    )._miextend(
        OLDTIPO="STRING"
    )
    start_date = baseraw.DateField(
        db_column="start_date",
        verbose_name=FLUtil.translate(u"Fecha de inicio", u"MetaData"),
        blank=True,
        null=True
    )._miextend(
        OLDTIPO="DATE"
    )
    finish_date = baseraw.DateField(
        db_column="finish_date",
        verbose_name=FLUtil.translate(u"Fecha de fin", u"MetaData"),
        blank=True,
        null=True
    )._miextend(
        OLDTIPO="DATE"
    )
    state = baseraw.CharField(
        db_column="state",
        verbose_name=FLUtil.translate(u"Estado", u"MetaData"),
        blank=False,
        null=False,
        default="Propuesta",
        max_length=30
    )._miextend(
        optionslist=u",Propuesta,Rechazado,Aceptado",
        OLDTIPO="STRING"
    )
    project = baseraw.ForeignKey(
        "project",
        db_column="idproject",
        verbose_name=FLUtil.translate(u"Proyecto", u"MetaData"),
        blank=False,
        null=False,
        to_field="idproject",
        on_delete=baseraw.PROTECT,
        related_name="sprints"
    )._miextend(
            OLDTIPO="SERIAL"
    )
    improvement = baseraw.ForeignKey(
        "improvement",
        db_column="idimprovement",
        verbose_name=FLUtil.translate(u"Mejora", u"MetaData"),
        blank=False,
        null=False,
        to_field="idimprovement",
        on_delete=baseraw.PROTECT,
        related_name="improvements"
    )._miextend(
            OLDTIPO="SERIAL"
    )
    action = baseraw.ForeignKey(
        "action",
        db_column="idaction",
        verbose_name=FLUtil.translate(u"Acción", u"MetaData"),
        blank=False,
        null=False,
        to_field="idaction",
        on_delete=baseraw.PROTECT,
        related_name="actions"
    )._miextend(
            OLDTIPO="SERIAL"
    )
    users = baseraw.ManyToManyField(User)

    def create(self, data):
        data['project'] = Project().load({'idproject':data['project']})
        data['improvement'] = Improvement().load({'idimprovement':data['improvement']})
        data['action'] = Action().load({'idaction':data['action']})
        users = data['users']
        del data['users']
        sprint = super().create(data)
        sprint.add_users(users)
        return sprint

    def update(self, data):
        if "project" in data:
            del data['project']
        if "users" in data:
            del data['users']
        data['improvement'] = Improvement().load({'idimprovement':data['improvement']})
        data['action'] = Action().load({'idaction':data['action']})
        return super().update(data)

    def get_improvements(self):
        return self.improvements.all()

    def get_action(self):
        return self.action.all()

    def get_users(self):
        return self.users.all()

    def get_tasks(self):
        return self.tasks.all()

    def add_users(self, users):
        for idUser in users:
            self.users.add(User().load(idUser))

    class Meta:
        abstract = True
Esempio n. 19
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Invitaciones", u"MetaData")
     db_table = u"aqn_invitations"
Esempio n. 20
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Acciones", u"MetaData")
     db_table = u"action"
Esempio n. 21
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Modulos", u"MetaData")
     db_table = u"aqn_modules"
Esempio n. 22
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Proyectos", u"MetaData")
     db_table = u"project"
Esempio n. 23
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Compañias", u"MetaData")
     db_table = u"aqn_companies"
Esempio n. 24
0
class trainb_project(interna_project):

    idproject = baseraw.AutoField(
        db_column="idproject",
        verbose_name=FLUtil.translate(u"Identificador", u"MetaData"),
        primary_key=True
    )._miextend(
        REQUIRED=True,
        OLDTIPO="SERIAL",
        visiblegrid=False,
    )
    name = baseraw.CharField(
        db_column="name",
        verbose_name=FLUtil.translate(u"Nombre", u"MetaData"),
        blank=False,
        null=False,
        max_length=200
    )._miextend(
        OLDTIPO="STRING"
    )

    description = baseraw.TextField(
        db_column="description",
        verbose_name=FLUtil.translate(u"Descripcion", u"MetaData"),
        blank=False,
        null=True,
    )._miextend(
        OLDTIPO="STRING"
    )

    budget = baseraw.CharField(
        db_column="budget",
        verbose_name=FLUtil.translate(u"Presupuesto", u"MetaData"),
        blank=False,
        null=True,
        max_length=12
    )._miextend(
        OLDTIPO="STRING"
    )

    cost = baseraw.CharField(
        db_column="cost",
        verbose_name=FLUtil.translate(u"Coste", u"MetaData"),
        blank=False,
        null=True,
        max_length=12
    )._miextend(
        OLDTIPO="STRING"
    )

    start_date = baseraw.DateField(
        db_column="start_date",
        verbose_name=FLUtil.translate(u"Fecha de comienzo", u"MetaData"),
        blank=True,
        null=True
    )._miextend(
        OLDTIPO="DATE"
    )

    finish_date = baseraw.DateField(
        db_column="finish_date",
        verbose_name=FLUtil.translate(u"Fecha de finalización", u"MetaData"),
        blank=True,
        null=True
    )._miextend(
        OLDTIPO="DATE"
    )

    leader = baseraw.ForeignKey(
        "leader",
        db_column="leader",
        verbose_name=FLUtil.translate(u"Líder del cambio", u"MetaData"),
        blank=False,
        null=False,
        max_length=30,
        to_field="idleader",
        on_delete=baseraw.PROTECT,
        related_name="project_leader__fk__leader_idleader"
    )._miextend(
        OLDTIPO="SERIAL"
    )

    consultant = baseraw.ForeignKey(
        "consultant",
        db_column="consultant",
        verbose_name=FLUtil.translate(u"Consultor", u"MetaData"),
        blank=False,
        null=False,
        max_length=30,
        to_field="idconsultant",
        on_delete=baseraw.PROTECT,
        related_name="projects"
    )._miextend(
        OLDTIPO="SERIAL"
    )

    def create(self, data):
        data['leader'] = Leader().load(data['leader'])
        data['consultant'] = Consultant().load(data['consultant'])
        return super().create(data)

    def update(self, data):
        data['leader'] = Leader().load(data['leader'])
        data['consultant'] = Consultant().load(data['consultant'])
        return super().update(data)

    class Meta:
        abstract = True
Esempio n. 25
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Direcciones", u"MetaData")
     db_table = u"address"
Esempio n. 26
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Usuarios", u"MetaData")
     db_table = u"sprint"
Esempio n. 27
0
class trainb_improvement(interna_improvement):

    idimprovement = baseraw.AutoField(
        db_column="idimprovement",
        verbose_name=FLUtil.translate(u"Identificador", u"MetaData"),
        primary_key=True
    )._miextend(
        REQUIRED=True,
        OLDTIPO="SERIAL",
        visiblegrid=False,
    )
    objective = baseraw.TextField(
        db_column="objective",
        verbose_name=FLUtil.translate(u"Objetivo", u"MetaData"),
        blank=True,
        null=True
    )
    cost = baseraw.FloatField(
        db_column="cost",
        verbose_name=FLUtil.translate(u"Coste", u"MetaData"),
        blank=True,
        null=True,
        default=None
    )
    priority = baseraw.IntegerField(
        db_column="priority",
        verbose_name=FLUtil.translate(u"Prioridad", u"MetaData"),
        blank=False,
        null=False,
        default=0
    )
    state = baseraw.CharField(
        db_column="state",
        verbose_name=FLUtil.translate(u"Estado", u"MetaData"),
        blank=False,
        null=False,
        default="Propuesta",
        max_length=30
    )._miextend(
        optionslist=u",Propuesta,Rechazada,Pendiente,En ejecución,En ejecución En medicion, En medicion finalizando, Finalizado",
        OLDTIPO="STRING"
    )
    project = baseraw.ForeignKey(
        "project",
        db_column="idproject",
        verbose_name=FLUtil.translate(u"Proyecto", u"MetaData"),
        blank=False,
        null=False,
        to_field="idproject",
        on_delete=baseraw.PROTECT,
        related_name="project"
    )._miextend(
        OLDTIPO="SERIAL"
    )

    def create(self, data):
        data['project'] = Project().load({'idproject':data['project']})
        problems = data['problems']
        actions = data['actions']
        # Limpio data para crear con sus campos unicamente
        del data['problems']
        del data['actions']
        mejora = super().create(data)

        mejora.createProblems(problems)
        mejora.createActions(actions)
        mejora.save()
        return mejora

    def update(self, data):
        if "problems" in data:
            del data['problems']
        if "actions" in data:
            del data['actions']
        if "project" in data:
            del data['project']
        return super().update(data)

    def createProblems(self, data):
        from models.fltrainb.problem import problem as Problem
        problems = []
        for problem in data:
            problem['improvement'] = self
            p = Problem().create(problem)
            problems.append(p)
        return problems

    def createActions(self, data):
        from models.fltrainb.action import action as Action

        actions = []
        for action in data:
            action['improvement'] = self
            action['state'] = 'Pendiente'
            actions.append(Action().create(action))
        return actions

    def get_problems(self):
        return self.problems.all()

    def get_actions(self):
        return self.actions.all()

    class Meta:
        abstract = True
Esempio n. 28
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Control de acceso", u"MetaData")
     db_table = 'sis_acl'
Esempio n. 29
0
class mtd_aqn_user(models.Model, BaseModel):
    idusuario = models.AutoField(db_column="idusuario",
                                 verbose_name=FLUtil.translate(
                                     u"Identificador", u"MetaData"),
                                 primary_key=True)._miextend(visiblegrid=False,
                                                             OLDTIPO="SERIAL")
    password = models.CharField(max_length=128)._miextend(OLDTIPO="STRING")
    last_login = models.DateTimeField(blank=True,
                                      null=True)._miextend(OLDTIPO="DATE")
    usuario = models.CharField(max_length=30, blank=True,
                               null=True)._miextend(OLDTIPO="STRING")
    nombre = models.CharField(max_length=30, blank=True,
                              null=True)._miextend(OLDTIPO="STRING")
    apellidos = models.CharField(max_length=30, blank=True,
                                 null=True)._miextend(OLDTIPO="STRING")
    email = models.CharField(unique=True,
                             max_length=254)._miextend(OLDTIPO="STRING")
    activo = models.BooleanField()._miextend(OLDTIPO="BOOL", default=True)
    idcompany = models.ForeignKey(
        "mtd_aqn_companies",
        db_column="idcompany",
        verbose_name=FLUtil.translate(u"Compañia", u"MetaData"),
        blank=True,
        null=True,
        to_field="idcompany",
        on_delete=FLUtil.deleteCascade,
        related_name="aqn_user_idcompany__fk__aqn_companies_idcompany"
    )._miextend(visiblegrid=False, OLDTIPO="UINT")
    idtareaactiva = models.IntegerField(db_column="idtareaactiva",
                                        verbose_name=FLUtil.translate(
                                            u"Tarea Activa", u"MetaData"),
                                        blank=True,
                                        null=True)._miextend(visiblegrid=False,
                                                             OLDTIPO="UINT")
    # idtareaactiva = models.ForeignKey("mtd_gt_tareas", db_column="idtareaactiva", verbose_name=FLUtil.translate(u"Tarea Activa", u"MetaData"), blank=True, null=True, to_field="idtarea", on_delete=models.PROTECT, related_name="aqn_user_idtareaactiva__fk__gt_tareas_idtarea")._miextend(visiblegrid=False, OLDTIPO="UINT")
    costehora = models.FloatField(db_column="costehora",
                                  verbose_name=FLUtil.translate(
                                      u"Coste hora", u"MetaData"),
                                  default=0,
                                  blank=True,
                                  null=True)._miextend(OLDTIPO="DOUBLE",
                                                       partI=4,
                                                       partD=2)
    nif = models.CharField(db_column="nif",
                           verbose_name=FLUtil.translate(u"NIF", u"MetaData"),
                           blank=True,
                           null=True,
                           max_length=10)._miextend(OLDTIPO="STRING")
    naf = models.CharField(db_column="naf",
                           verbose_name=FLUtil.translate(u"NAF", u"MetaData"),
                           blank=True,
                           null=True,
                           max_length=14)._miextend(OLDTIPO="STRING")
    idresponsable = models.IntegerField(db_column="idresponsable",
                                        verbose_name=FLUtil.translate(
                                            "MetaData", "Responsable"),
                                        blank=True,
                                        null=True)._miextend(OLDTIPO="UINT")

    class Meta:
        managed = True
        verbose_name = "Usuarios"
        db_table = 'aqn_user'
Esempio n. 30
0
 class Meta:
     managed = True
     verbose_name = FLUtil.translate(u"Consultores", u"MetaData")
     db_table = u"comment"