login tested updated
This commit is contained in:
@@ -209,7 +209,7 @@ class CrudActions(SystemFields):
|
||||
return return_dict
|
||||
|
||||
|
||||
class CRUDModel(BaseAlchemyModel, CrudActions):
|
||||
class CRUDModel(CrudActions):
|
||||
|
||||
__abstract__ = True
|
||||
|
||||
|
||||
@@ -10,15 +10,13 @@ from typing import Any, TypeVar, Type
|
||||
|
||||
from sqlalchemy.orm import Query, Session
|
||||
from sqlalchemy.sql.elements import BinaryExpression
|
||||
from sqlalchemy_mixins.smartquery import SmartQueryMixin
|
||||
|
||||
from Services.PostgresDb.Models.response import PostgresResponse
|
||||
from Services.PostgresDb.Models.core_alchemy import BaseAlchemyModel
|
||||
|
||||
from ApiLayers.ApiLibrary import system_arrow
|
||||
|
||||
|
||||
T = TypeVar("T", bound="FilterAttributes")
|
||||
T = TypeVar("T", bound="QueryModel")
|
||||
|
||||
|
||||
class ArgumentModel:
|
||||
@@ -63,7 +61,7 @@ class ArgumentModel:
|
||||
return arg
|
||||
|
||||
|
||||
class QueryModel(ArgumentModel, BaseAlchemyModel, SmartQueryMixin):
|
||||
class QueryModel(ArgumentModel):
|
||||
|
||||
pre_query = None
|
||||
__abstract__ = True
|
||||
@@ -127,8 +125,8 @@ class QueryModel(ArgumentModel, BaseAlchemyModel, SmartQueryMixin):
|
||||
args = cls.get_active_and_confirmed_query_arg(args)
|
||||
if not expired:
|
||||
args = cls.get_not_expired_query_arg(args)
|
||||
query = cls._query(db).filter(*args)
|
||||
return PostgresResponse(pre_query=cls._query(db), query=query, is_array=False)
|
||||
query = cls._query(db=db).filter(*args)
|
||||
return PostgresResponse(pre_query=cls._query(db=db), query=query, is_array=False)
|
||||
|
||||
@classmethod
|
||||
def filter_all_system(
|
||||
|
||||
@@ -12,18 +12,21 @@ from sqlalchemy import (
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy_mixins.serialize import SerializeMixin
|
||||
from sqlalchemy_mixins.repr import ReprMixin
|
||||
from sqlalchemy_mixins.smartquery import SmartQueryMixin
|
||||
|
||||
from Services.PostgresDb.Models.core_alchemy import BaseAlchemyModel
|
||||
from Services.PostgresDb.Models.crud_alchemy import CRUDModel
|
||||
from Services.PostgresDb.Models.filter_functions import QueryModel
|
||||
from Services.PostgresDb.database import Base
|
||||
|
||||
|
||||
class BasicMixin(CRUDModel, QueryModel):
|
||||
class BasicMixin(Base, BaseAlchemyModel):
|
||||
|
||||
__abstract__ = True
|
||||
__repr__ = ReprMixin.__repr__
|
||||
|
||||
|
||||
class CrudMixin(BasicMixin, SerializeMixin, ReprMixin):
|
||||
class CrudMixin(BasicMixin, CRUDModel, SerializeMixin, ReprMixin, SmartQueryMixin, QueryModel ):
|
||||
"""
|
||||
Base mixin providing CRUD operations and common fields for PostgreSQL models.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user