auth service up running
This commit is contained in:
@@ -41,6 +41,7 @@ from databases.language_models.building.build import (
|
||||
BuildPersonProvidingLanguageModel,
|
||||
)
|
||||
|
||||
|
||||
class BuildTypes(CrudCollection):
|
||||
"""
|
||||
BuildTypes class based on declarative_base and BaseMixin via session
|
||||
@@ -177,12 +178,8 @@ class Build(CrudCollection, SelectActionWithEmployee):
|
||||
heating_system: Mapped[bool] = mapped_column(Boolean, server_default="True")
|
||||
cooling_system: Mapped[bool] = mapped_column(Boolean, server_default="False")
|
||||
hot_water_system: Mapped[bool] = mapped_column(Boolean, server_default="False")
|
||||
block_service_man_count: Mapped[int] = mapped_column(
|
||||
Integer, server_default="0"
|
||||
)
|
||||
security_service_man_count: Mapped[int] = mapped_column(
|
||||
Integer, server_default="0"
|
||||
)
|
||||
block_service_man_count: Mapped[int] = mapped_column(Integer, server_default="0")
|
||||
security_service_man_count: Mapped[int] = mapped_column(Integer, server_default="0")
|
||||
garage_count: Mapped[int] = mapped_column(
|
||||
Integer, server_default="0", comment="Garage Count"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,16 @@ from fastapi.exceptions import HTTPException
|
||||
|
||||
from databases.sql_models.core_mixin import CrudCollection
|
||||
|
||||
from sqlalchemy import String, Integer, Boolean, ForeignKey, Index, Identity, TIMESTAMP, func
|
||||
from sqlalchemy import (
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
ForeignKey,
|
||||
Index,
|
||||
Identity,
|
||||
TIMESTAMP,
|
||||
func,
|
||||
)
|
||||
from sqlalchemy.orm import mapped_column, relationship, Mapped
|
||||
|
||||
from api_configs import RelationAccess
|
||||
|
||||
@@ -9,12 +9,14 @@ engine_config = {
|
||||
"pool_size": 20,
|
||||
"max_overflow": 10,
|
||||
"echo": True,
|
||||
"echo_pool":True,
|
||||
"echo_pool": True,
|
||||
"isolation_level": "READ COMMITTED",
|
||||
"pool_pre_ping": True,
|
||||
}
|
||||
|
||||
engine = create_engine(**engine_config, )
|
||||
engine = create_engine(
|
||||
**engine_config,
|
||||
)
|
||||
SessionLocal = sessionmaker(bind=engine, autoflush=False, autocommit=False)
|
||||
session = scoped_session(sessionmaker(bind=engine))
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ class FilterAttributes:
|
||||
meta_data = getattr(cls, "meta_data", {})
|
||||
meta_data_created = meta_data.get("created", False)
|
||||
if meta_data_created:
|
||||
print('meta_data_created commit', meta_data_created)
|
||||
print("meta_data_created commit", meta_data_created)
|
||||
cls.__session__.commit()
|
||||
print('meta_data_created rollback', meta_data_created)
|
||||
print("meta_data_created rollback", meta_data_created)
|
||||
cls.__session__.rollback()
|
||||
# cls.raise_http_exception(
|
||||
# status_code="HTTP_304_NOT_MODIFIED",
|
||||
@@ -82,6 +82,7 @@ class FilterAttributes:
|
||||
data={},
|
||||
message=str(e.__context__).split("\n")[0],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def rollback(cls):
|
||||
"""Rollback the current session."""
|
||||
|
||||
Reference in New Issue
Block a user