Skip to content

Commit

Permalink
Merge pull request #14 from guivaloz/guivaloz/timbrado-cancelado
Browse files Browse the repository at this point in the history
Mejor filtro por estatus A
  • Loading branch information
guivaloz authored Jul 12, 2024
2 parents 461eec2 + 23c52a5 commit 7564f12
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 74 deletions.
2 changes: 1 addition & 1 deletion perseo/v4/autoridades/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_autoridades(
consulta = consulta.filter_by(distrito_id=distrito.id)
if es_extinto is not None:
consulta = consulta.filter_by(es_extinto=es_extinto)
return consulta.filter_by(estatus="A").order_by(Autoridad.clave)
return consulta.filter(Autoridad.estatus == "A").order_by(Autoridad.clave)


def get_autoridad(database: Session, autoridad_id: int) -> Autoridad:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/bitacoras/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_bitacoras(
elif usuario_email is not None:
usuario = get_usuario_with_email(database, usuario_email)
consulta = consulta.filter_by(usuario_id=usuario.id)
return consulta.filter_by(estatus="A").order_by(Bitacora.id)
return consulta.filter(Bitacora.estatus == "A").order_by(Bitacora.id)


def get_bitacora(database: Session, bitacora_id: int) -> Bitacora:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/distritos/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_distritos(
consulta = consulta.filter_by(es_distrito=es_distrito)
if es_jurisdiccional is not None:
consulta = consulta.filter_by(es_jurisdiccional=es_jurisdiccional)
return consulta.filter_by(estatus="A").order_by(Distrito.clave)
return consulta.filter(Distrito.estatus == "A").order_by(Distrito.clave)


def get_distrito(database: Session, distrito_id: int) -> Distrito:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/entradas_salidas/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_entradas_salidas(
elif usuario_email is not None:
usuario = get_usuario_with_email(database, usuario_email)
consulta = consulta.filter_by(usuario_id=usuario.id)
return consulta.filter_by(estatus="A").order_by(EntradaSalida.id)
return consulta.filter(EntradaSalida.estatus == "A").order_by(EntradaSalida.id)


def get_entrada_salida(database: Session, entrada_salida_id: int) -> EntradaSalida:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/nominas/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_nominas(
if rfc is not None:
persona = get_persona_with_rfc(database, rfc)
consulta = consulta.filter_by(persona_id=persona.id)
return consulta.filter_by(estatus="A").order_by(Nomina.id.desc())
return consulta.filter(Nomina.estatus == "A").order_by(Nomina.id.desc())


def get_nomina(database: Session, nomina_id: int) -> Nomina:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/permisos/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_permisos(
elif rol_nombre is not None:
rol = get_rol_with_nombre(database, rol_nombre)
consulta = consulta.filter_by(rol_id=rol.id)
return consulta.filter_by(estatus="A").order_by(Permiso.id)
return consulta.filter(Permiso.estatus == "A").order_by(Permiso.id)


def get_permiso(database: Session, permiso_id: int) -> Permiso:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/personas/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_personas(
except ValueError as error:
raise MyNotValidParamError(str(error)) from error
consulta = consulta.filter(Persona.curp.contains(curp))
return consulta.filter_by(estatus="A").order_by(Persona.id)
return consulta.filter(Persona.estatus == "A").order_by(Persona.id)


def get_persona(database: Session, persona_id: int) -> Persona:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/tabuladores/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_tabuladores(
if puesto_id is not None:
puesto = get_puesto(database, puesto_id)
consulta = consulta.filter_by(puesto_id=puesto.id)
return consulta.filter_by(estatus="A").order_by(Tabulador.id)
return consulta.filter(Tabulador.estatus == "A").order_by(Tabulador.id)


def get_tabulador(database: Session, tabulador_id: int) -> Tabulador:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/tareas/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_tareas(
elif usuario_email is not None:
usuario = get_usuario_with_email(database, usuario_email)
consulta = consulta.filter_by(usuario_id=usuario.id)
return consulta.filter_by(estatus="A").order_by(Tarea.id)
return consulta.filter(Tarea.estatus == "A").order_by(Tarea.id)


def get_tarea(database: Session, tarea_id: int) -> Tarea:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/timbrados/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_timbrados(
if rfc is not None:
persona = get_persona_with_rfc(database, rfc)
consulta = consulta.filter(Nomina.persona_id == persona.id)
return consulta.filter_by(estatus="A").order_by(Timbrado.id.desc())
return consulta.filter(Timbrado.estatus == "A").order_by(Timbrado.id.desc())


def get_timbrado(database: Session, timbrado_id: int) -> Timbrado:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/usuarios/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_usuarios(
nombres = safe_string(nombres)
if nombres != "":
consulta = consulta.filter(Usuario.nombres.contains(nombres))
return consulta.filter_by(estatus="A").order_by(Usuario.email)
return consulta.filter(Usuario.estatus == "A").order_by(Usuario.email)


def get_usuario(database: Session, usuario_id: int) -> Usuario:
Expand Down
2 changes: 1 addition & 1 deletion perseo/v4/usuarios_roles/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_usuarios_roles(
elif usuario_email is not None:
usuario = get_usuario_with_email(database, usuario_email)
consulta = consulta.filter_by(usuario_id=usuario.id)
return consulta.filter_by(estatus="A").order_by(UsuarioRol.id)
return consulta.filter(UsuarioRol.estatus == "A").order_by(UsuarioRol.id)


def get_usuario_rol(database: Session, usuario_rol_id: int) -> UsuarioRol:
Expand Down
50 changes: 26 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
cryptography = "^41.0.7"
fastapi = "^0.108.0"
fastapi-pagination = {extras = ["sqlalchemy"], version = "^0.12.14"}
google-auth = "^2.25.2"
google-cloud = "^0.34.0"
google-cloud-secret-manager = "^2.17.0"
google-cloud-storage = "^2.14.0"
gunicorn = "^21.2.0"
hashids = "^1.3.1"
psycopg2-binary = "^2.9.9"
pydantic = "^2.5.3"
pydantic-settings = "^2.1.0"
python-dotenv = "^1.0.0"
pytz = "^2023.3.post1"
sqlalchemy = "^2.0.24"
sqlalchemy-utils = "^0.41.1"
unidecode = "^1.3.7"
uvicorn = "^0.25.0"
cryptography = "^42.0"
fastapi = {extras = ["sqlalchemy"], version = "^0.111"}
fastapi-pagination = "^0.12"
google-auth = "^2.32"
google-cloud = "^0.34"
google-cloud-secret-manager = "^2.20"
google-cloud-storage = "^2.14"
gunicorn = "^22.0"
hashids = "^1.3"
psycopg2-binary = "^2.9"
pydantic = "^2.5"
pydantic-settings = "^2.1"
python-dotenv = "^1.0"
pytz = "^2024.1"
sqlalchemy = "^2.0"
sqlalchemy-utils = "^0.41"
unidecode = "^1.3"
uvicorn = "^0.30"


[tool.poetry.group.dev.dependencies]
black = "^23.12.1"
isort = "^5.13.2"
pre-commit = "^3.6.0"
pylint = "^3.0.3"
pylint-sqlalchemy = "^0.3.0"
pytest = "^7.4.3"
black = "^24.4"
faker = "^26.0"
isort = "^5.13"
poetry-plugin-export = "^1.8"
pylint = "^3.0"
pylint-sqlalchemy = "^0.3"
pytest = "^8.2"
pre-commit = "^3.6"

[build-system]
requires = ["poetry-core"]
Expand Down
95 changes: 57 additions & 38 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,74 @@
annotated-types==0.6.0 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.3.0 ; python_version >= "3.11" and python_version < "4.0"
annotated-types==0.7.0 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.4.0 ; python_version >= "3.11" and python_version < "4.0"
cachetools==5.3.3 ; python_version >= "3.11" and python_version < "4.0"
certifi==2024.2.2 ; python_version >= "3.11" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
certifi==2024.7.4 ; python_version >= "3.11" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
charset-normalizer==3.3.2 ; python_version >= "3.11" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.11" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and platform_system == "Windows"
cryptography==41.0.7 ; python_version >= "3.11" and python_version < "4.0"
fastapi-pagination[sqlalchemy]==0.12.22 ; python_version >= "3.11" and python_version < "4.0"
fastapi==0.108.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core==2.18.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.18.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.29.0 ; python_version >= "3.11" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows")
cryptography==42.0.8 ; python_version >= "3.11" and python_version < "4.0"
dnspython==2.6.1 ; python_version >= "3.11" and python_version < "4.0"
email-validator==2.2.0 ; python_version >= "3.11" and python_version < "4.0"
fastapi-cli==0.0.4 ; python_version >= "3.11" and python_version < "4.0"
fastapi-pagination==0.12.26 ; python_version >= "3.11" and python_version < "4.0"
fastapi[sqlalchemy]==0.111.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core==2.19.1 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.19.1 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.32.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-core==2.4.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-secret-manager==2.19.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.16.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-secret-manager==2.20.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.17.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud==0.34.0 ; python_version >= "3.11" and python_version < "4.0"
google-crc32c==1.5.0 ; python_version >= "3.11" and python_version < "4.0"
google-resumable-media==2.7.0 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos==1.63.0 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos[grpc]==1.63.0 ; python_version >= "3.11" and python_version < "4.0"
greenlet==3.0.3 ; python_version >= "3.11" and python_version < "4.0" and (platform_machine == "win32" or platform_machine == "WIN32" or platform_machine == "AMD64" or platform_machine == "amd64" or platform_machine == "x86_64" or platform_machine == "ppc64le" or platform_machine == "aarch64")
grpc-google-iam-v1==0.13.0 ; python_version >= "3.11" and python_version < "4.0"
grpcio-status==1.62.1 ; python_version >= "3.11" and python_version < "4.0"
grpcio==1.62.1 ; python_version >= "3.11" and python_version < "4.0"
gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "4.0"
google-resumable-media==2.7.1 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos==1.63.2 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos[grpc]==1.63.2 ; python_version >= "3.11" and python_version < "4.0"
greenlet==3.0.3 ; python_version < "3.13" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version >= "3.11"
grpc-google-iam-v1==0.13.1 ; python_version >= "3.11" and python_version < "4.0"
grpcio-status==1.64.1 ; python_version >= "3.11" and python_version < "4.0"
grpcio==1.64.1 ; python_version >= "3.11" and python_version < "4.0"
gunicorn==22.0.0 ; python_version >= "3.11" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.11" and python_version < "4.0"
hashids==1.3.1 ; python_version >= "3.11" and python_version < "4.0"
httpcore==1.0.5 ; python_version >= "3.11" and python_version < "4.0"
httptools==0.6.1 ; python_version >= "3.11" and python_version < "4.0"
httpx==0.27.0 ; python_version >= "3.11" and python_version < "4.0"
idna==3.7 ; python_version >= "3.11" and python_version < "4.0"
packaging==24.0 ; python_version >= "3.11" and python_version < "4.0"
proto-plus==1.23.0 ; python_version >= "3.11" and python_version < "4.0"
protobuf==4.25.3 ; python_version >= "3.11" and python_version < "4.0"
jinja2==3.1.4 ; python_version >= "3.11" and python_version < "4.0"
markdown-it-py==3.0.0 ; python_version >= "3.11" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.11" and python_version < "4.0"
orjson==3.10.6 ; python_version >= "3.11" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.11" and python_version < "4.0"
proto-plus==1.24.0 ; python_version >= "3.11" and python_version < "4.0"
protobuf==5.27.2 ; python_version >= "3.11" and python_version < "4.0"
psycopg2-binary==2.9.9 ; python_version >= "3.11" and python_version < "4.0"
pyasn1-modules==0.4.0 ; python_version >= "3.11" and python_version < "4.0"
pyasn1==0.6.0 ; python_version >= "3.11" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.11" and python_version < "4.0"
pydantic-core==2.18.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic-settings==2.2.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.7.0 ; python_version >= "3.11" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.11" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
pydantic-core==2.20.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic-settings==2.3.4 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.8.2 ; python_version >= "3.11" and python_version < "4.0"
pygments==2.18.0 ; python_version >= "3.11" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.11" and python_version < "4.0"
pytz==2023.4 ; python_version >= "3.11" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.11" and python_version < "4.0"
python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "4.0"
pytz==2024.1 ; python_version >= "3.11" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.11" and python_version < "4.0"
rich==13.7.1 ; python_version >= "3.11" and python_version < "4.0"
rsa==4.9 ; python_version >= "3.11" and python_version < "4"
six==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.11" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.11" and python_version < "4.0"
sqlakeyset==2.0.1708907391 ; python_version >= "3.11" and python_version < "4.0"
sqlalchemy-utils==0.41.2 ; python_version >= "3.11" and python_version < "4.0"
sqlalchemy==2.0.29 ; python_version >= "3.11" and python_version < "4.0"
starlette==0.32.0.post1 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.11.0 ; python_version >= "3.11" and python_version < "4.0"
sqlalchemy==2.0.31 ; python_version >= "3.11" and python_version < "4.0"
starlette==0.37.2 ; python_version >= "3.11" and python_version < "4.0"
typer==0.12.3 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0"
ujson==5.10.0 ; python_version >= "3.11" and python_version < "4.0"
unidecode==1.3.8 ; python_version >= "3.11" and python_version < "4.0"
urllib3==2.2.1 ; python_version >= "3.11" and python_version < "4.0"
uvicorn==0.25.0 ; python_version >= "3.11" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.11" and python_version < "4.0"
uvicorn==0.30.1 ; python_version >= "3.11" and python_version < "4.0"
uvicorn[standard]==0.30.1 ; python_version >= "3.11" and python_version < "4.0"
uvloop==0.19.0 ; (sys_platform != "win32" and sys_platform != "cygwin") and platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "4.0"
watchfiles==0.22.0 ; python_version >= "3.11" and python_version < "4.0"
websockets==12.0 ; python_version >= "3.11" and python_version < "4.0"

0 comments on commit 7564f12

Please sign in to comment.