-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from guivaloz:guivaloz/recibir-exhortos
Guivaloz/recibir-exhortos
- Loading branch information
Showing
10 changed files
with
245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
Estados, modelos | ||
""" | ||
|
||
from sqlalchemy import Column, Integer, String | ||
from sqlalchemy.orm import relationship | ||
|
||
from lib.database import Base | ||
from lib.universal_mixin import UniversalMixin | ||
|
||
|
||
class Estado(Base, UniversalMixin): | ||
"""Estado""" | ||
|
||
# Nombre de la tabla | ||
__tablename__ = "estados" | ||
|
||
# Clave primaria | ||
id = Column(Integer, primary_key=True) | ||
|
||
# Columnas | ||
clave = Column(String(2), nullable=False, unique=True) | ||
nombre = Column(String(256), nullable=False) | ||
|
||
# Hijos | ||
municipios = relationship("Municipio", back_populates="estado") | ||
|
||
def __repr__(self): | ||
"""Representación""" | ||
return f"<Estado {self.id}>" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
""" | ||
Exhortos, modelos | ||
""" | ||
|
||
from sqlalchemy import Boolean, Column, Date, Enum, ForeignKey, Integer, String | ||
from sqlalchemy.orm import relationship | ||
|
||
from lib.database import Base | ||
from lib.universal_mixin import UniversalMixin | ||
|
||
|
||
class Exhorto(Base, UniversalMixin): | ||
"""Exhorto""" | ||
|
||
# Nombre de la tabla | ||
__tablename__ = "exhortos" | ||
|
||
# Clave primaria | ||
id = Column(Integer, primary_key=True) | ||
|
||
# UUID identificador con el que el PJ exhortante identifica el exhorto que envía | ||
exhorto_origen_id = Column(String(64), nullable=False, unique=True) | ||
|
||
# Identificador INEGI del Municipio del Estado del PJ exhortado al que se quiere enviar el Exhorto | ||
municipio_destino_id = Column(Integer, ForeignKey("municipios.id"), index=True, nullable=False) | ||
municipio_destino = relationship("Municipio", back_populates="exhortos_destinos") | ||
|
||
# Clave de la materia (el que se obtuvo en la consulta de materias del PJ exhortado) al que el Exhorto hace referencia | ||
materia_id = Column(Integer, ForeignKey("materias.id"), index=True, nullable=False) | ||
materia = relationship("Materia", back_populates="exhortos") | ||
|
||
# Identificador INEGI del Estado de origen del Municipio donde se ubica el Juzgado del PJ exhortante | ||
# estado_origen_id = Column(Integer, ForeignKey("estados.id"), index=True, nullable=False) | ||
# estado_origen = relationship("Estado", back_populates="exhortos") | ||
|
||
# Identificador INEGI del Municipio donde está localizado el Juzgado del PJ exhortante | ||
municipio_origen_id = Column(Integer, ForeignKey("municipios.id"), index=True, nullable=False) | ||
municipio_origen = relationship("Municipio", back_populates="exhortos_origenes") | ||
|
||
# Identificador propio del Juzgado/Área que envía el Exhorto | ||
juzgado_origen_id = Column(String(64)) | ||
|
||
# Nombre del Juzgado/Área que envía el Exhorto | ||
juzgado_origen_nombre = Column(String(256), nullable=False) | ||
|
||
# El número de expediente (o carpeta procesal, carpeta...) que tiene el asunto en el Juzgado de Origen | ||
# numeroExpedienteOrigen string SI | ||
numero_expediente_origen = Column(String(256), nullable=False) | ||
|
||
# numeroOficioOrigen string NO | ||
# tipoJuicioAsuntoDelitos string SI | ||
# juezExhortante string NO | ||
# partes PersonaParte[] NO | ||
# fojas int SI | ||
# diasResponder int SI | ||
# tipoDiligenciacionNombre string NO | ||
# fechaOrigen datetime NO | ||
# observaciones string NO | ||
# archivos ArchivoARecibir[] SI | ||
|
||
@property | ||
def estadoOrigenId(self): | ||
"""ID del estado de origen""" | ||
return self.municipio_origen.estado_id | ||
|
||
@property | ||
def materiaClave(self): | ||
"""Clave de la materia""" | ||
return self.materia.clave | ||
|
||
@property | ||
def municipioOrigenId(self): | ||
"""ID del municipio de origen""" | ||
return self.municipio_origen_id | ||
|
||
def __repr__(self): | ||
"""Representación""" | ||
return f"<Exhorto {self.id}>" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
Municipios, modelos | ||
""" | ||
|
||
from sqlalchemy import Column, ForeignKey, Integer, String | ||
from sqlalchemy.orm import relationship | ||
|
||
from lib.database import Base | ||
from lib.universal_mixin import UniversalMixin | ||
|
||
|
||
class Municipio(Base, UniversalMixin): | ||
"""Municipio""" | ||
|
||
# Nombre de la tabla | ||
__tablename__ = "municipios" | ||
|
||
# Clave primaria | ||
id = Column(Integer, primary_key=True) | ||
|
||
# Clave foránea | ||
estado_id = Column(Integer, ForeignKey("estados.id"), index=True, nullable=False) | ||
estado = relationship("Estado", back_populates="municipios") | ||
|
||
# Columnas | ||
clave = Column(String(3), nullable=False) | ||
nombre = Column(String(256), nullable=False) | ||
|
||
# Hijos | ||
exhortos_destinos = relationship("Exhorto", back_populates="municipio_destino") | ||
exhortos_origenes = relationship("Exhorto", back_populates="municipio_origen") | ||
|
||
def __repr__(self): | ||
"""Representación""" | ||
return f"<Municipio {self.id}>" |