86 lines
3.4 KiB
Python
86 lines
3.4 KiB
Python
![]() |
# This is an auto-generated Django model module.
|
|||
|
# You'll have to do the following manually to clean this up:
|
|||
|
# * Rearrange models' order
|
|||
|
# * Make sure each model has one field with primary_key=True
|
|||
|
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
|
|||
|
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
|
|||
|
# Feel free to rename the models, but don't rename db_table values or field names.
|
|||
|
from django.db import models
|
|||
|
|
|||
|
|
|||
|
class Aplicacion(models.Model):
|
|||
|
id_aplicacion = models.IntegerField(primary_key=True)
|
|||
|
app = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
vigente = models.BooleanField(blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'aplicaciones'
|
|||
|
|
|||
|
|
|||
|
class Persona(models.Model):
|
|||
|
rut = models.DecimalField(primary_key=True, max_digits=12, decimal_places=0)
|
|||
|
id_tipo_tratamiento = models.ForeignKey('TipoTratamientoPersona', models.DO_NOTHING, db_column='id_tipo_tratamiento', blank=True, null=True)
|
|||
|
dv = models.CharField(max_length=1, blank=True, null=True)
|
|||
|
nombres = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
apellido_a = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
apellido_b = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
fono = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
email = models.CharField(max_length=100, blank=True, null=True)
|
|||
|
fecha_nacimiento = models.DateField(blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'persona'
|
|||
|
|
|||
|
|
|||
|
class Rol(models.Model):
|
|||
|
id_rol = models.IntegerField(primary_key=True)
|
|||
|
nombre_rol = models.CharField(max_length=100)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'rol'
|
|||
|
|
|||
|
|
|||
|
class RolAplicacion(models.Model):
|
|||
|
id_aplicacion = models.OneToOneField(Aplicacion, models.DO_NOTHING, db_column='id_aplicacion', primary_key=True) # The composite primary key (id_aplicacion, id_rol) found, that is not supported. The first column is selected.
|
|||
|
id_rol = models.ForeignKey(Rol, models.DO_NOTHING, db_column='id_rol')
|
|||
|
solo_visualizar = models.BooleanField(blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'rol_aplicacion'
|
|||
|
unique_together = (('id_aplicacion', 'id_rol'),)
|
|||
|
|
|||
|
|
|||
|
class TipoTratamientoPersona(models.Model):
|
|||
|
id_tipo_tratamiento = models.IntegerField(primary_key=True)
|
|||
|
tratamiento = models.CharField(max_length=50, blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'tipo_tratamiento_persona'
|
|||
|
db_table_comment = 'Establece el tratamiento de como dirigirse hacia una persona:\r\nEjemplo\r\nSe<EFBFBD>or\r\nSe<EFBFBD>ora\r\nSrta'
|
|||
|
|
|||
|
|
|||
|
class Usuario(models.Model):
|
|||
|
login = models.CharField(primary_key=True, max_length=20)
|
|||
|
rut = models.ForeignKey(Persona, models.DO_NOTHING, db_column='rut', blank=True, null=True)
|
|||
|
clave = models.CharField(max_length=20, blank=True, null=True)
|
|||
|
vigente = models.BooleanField(blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'usuario'
|
|||
|
|
|||
|
|
|||
|
class UsuarioRol(models.Model):
|
|||
|
login = models.ForeignKey(Usuario, models.DO_NOTHING, db_column='login', blank=True, null=True)
|
|||
|
id_rol = models.ForeignKey(Rol, models.DO_NOTHING, db_column='id_rol', blank=True, null=True)
|
|||
|
vigente = models.BooleanField(blank=True, null=True)
|
|||
|
|
|||
|
class Meta:
|
|||
|
managed = False
|
|||
|
db_table = 'usuario_rol'
|