Skip to content

Commit

Permalink
Merge pull request #11 from guivaloz:guivaloz/update
Browse files Browse the repository at this point in the history
Nuevos modelos en personas y nominas
  • Loading branch information
guivaloz authored Apr 16, 2024
2 parents 32e2981 + cf7467a commit 3a0a226
Show file tree
Hide file tree
Showing 22 changed files with 62 additions and 35 deletions.
5 changes: 4 additions & 1 deletion lib/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Database
"""

from typing import Annotated

from fastapi import Depends
Expand All @@ -17,7 +18,9 @@ def get_engine(settings: Annotated[Settings, Depends(get_settings)]) -> Engine:
"""Database engine"""

# Create engine
engine = create_engine(f"postgresql+psycopg2://{settings.db_user}:{settings.db_pass}@{settings.db_host}:{settings.db_port}/{settings.db_name}")
engine = create_engine(
f"postgresql+psycopg2://{settings.db_user}:{settings.db_pass}@{settings.db_host}:{settings.db_port}/{settings.db_name}"
)

return engine

Expand Down
1 change: 1 addition & 0 deletions lib/fastapi_pagination_custom_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async def list_examples(
return paginate(query)
"""

from math import ceil
from typing import Any, Generic, Optional, Sequence, TypeVar

Expand Down
1 change: 1 addition & 0 deletions lib/fastapi_pagination_custom_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def list_examples(
return paginate(query)
"""

from abc import ABC
from typing import Any, Generic, Optional, Sequence, TypeVar

Expand Down
1 change: 1 addition & 0 deletions lib/safe_string.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Safe string
"""

import re
from datetime import date

Expand Down
1 change: 1 addition & 0 deletions lib/schemas_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Schemas Base
"""

from pydantic import BaseModel


Expand Down
1 change: 1 addition & 0 deletions lib/universal_mixin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
UniversalMixin define las columnas y métodos comunes de todos los modelos
"""

import re

from hashids import Hashids
Expand Down
1 change: 1 addition & 0 deletions perseo/core/autoridades/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Autoridades, modelos
"""

from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/bitacoras/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Bitacoras, modelos
"""

from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/distritos/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Distritos, modelos
"""

from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/entradas_salidas/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Entradas-Salidas, modelos
"""

from collections import OrderedDict

from sqlalchemy import Column, Enum, ForeignKey, Integer, String
Expand Down
1 change: 1 addition & 0 deletions perseo/core/modulos/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Modulos, modelos
"""

from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.orm import relationship

Expand Down
4 changes: 3 additions & 1 deletion perseo/core/nominas/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
Nominas, modelos
"""
from sqlalchemy import Column, Date, Enum, ForeignKey, Integer, Numeric, String

from sqlalchemy import Column, Date, Enum, ForeignKey, Integer
from sqlalchemy.orm import relationship

from lib.database import Base
Expand All @@ -16,6 +17,7 @@ class Nomina(Base, UniversalMixin):
"APOYO ANUAL": "APOYO ANUAL",
"DESPENSA": "DESPENSA",
"SALARIO": "SALARIO",
"EXTRAORDINARIO": "EXTRAORDINARIO",
}

# Nombre de la tabla
Expand Down
1 change: 1 addition & 0 deletions perseo/core/permisos/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Permisos, modelos
"""

from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
6 changes: 5 additions & 1 deletion perseo/core/personas/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Personas, modelos
"""

from sqlalchemy import Column, Date, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand All @@ -14,7 +15,10 @@ class Persona(Base, UniversalMixin):
MODELOS = {
1: "CONFIANZA",
2: "SINDICALIZADO",
3: "JUBILADO",
3: "PENSIONADO",
4: "BENEFICIARIO PENSION ALIMENTICIA",
5: "ASIMILADO A SALARIOS",
6: "EXTRAORDINARIO",
}

# Nombre de la tabla
Expand Down
1 change: 1 addition & 0 deletions perseo/core/puestos/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Puestos, modelos
"""

from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/roles/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Roles, modelos
"""

from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/tabuladores/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tabuladores, modelos
"""

from sqlalchemy import Column, Date, ForeignKey, Integer, Numeric
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/tareas/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tareas, modelos
"""

from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/timbrados/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Timbrados, modelos
"""

from sqlalchemy import Column, Enum, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/usuarios/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Usuarios, modelos
"""

from sqlalchemy import Column, DateTime, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
1 change: 1 addition & 0 deletions perseo/core/usuarios_roles/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Usuarios-Roles, modelos
"""

from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

Expand Down
64 changes: 32 additions & 32 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
annotated-types==0.6.0 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.2.0 ; python_version >= "3.11" and python_version < "4.0"
cachetools==5.3.2 ; python_version >= "3.11" and python_version < "4.0"
certifi==2023.11.17 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.3.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"
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.14 ; 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.15.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.15.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.25.2 ; 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"
google-cloud-core==2.4.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-secret-manager==2.17.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.14.0 ; 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==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.62.0 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos[grpc]==1.62.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.60.0 ; python_version >= "3.11" and python_version < "4.0"
grpcio==1.60.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"
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"
idna==3.6 ; python_version >= "3.11" and python_version < "4.0"
packaging==23.2 ; 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.1 ; python_version >= "3.11" and python_version < "4.0"
protobuf==4.25.3 ; 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.3.0 ; python_version >= "3.11" and python_version < "4.0"
pyasn1==0.5.1 ; python_version >= "3.11" and python_version < "4.0"
pycparser==2.21 ; python_version >= "3.11" and python_version < "4.0"
pydantic-core==2.14.6 ; python_version >= "3.11" and python_version < "4.0"
pydantic-settings==2.1.0 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.5.3 ; python_version >= "3.11" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.11" and python_version < "4.0"
python-dotenv==1.0.0 ; python_version >= "3.11" and python_version < "4.0"
pytz==2023.3.post1 ; 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"
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"
rsa==4.9 ; python_version >= "3.11" and python_version < "4"
six==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
sniffio==1.3.0 ; python_version >= "3.11" and python_version < "4.0"
sqlakeyset==2.0.1701229837 ; python_version >= "3.11" and python_version < "4.0"
sqlalchemy-utils==0.41.1 ; python_version >= "3.11" and python_version < "4.0"
sqlalchemy==2.0.24 ; 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.9.0 ; python_version >= "3.11" and python_version < "4.0"
unidecode==1.3.7 ; python_version >= "3.11" and python_version < "4.0"
urllib3==2.1.0 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.11.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"

0 comments on commit 3a0a226

Please sign in to comment.