#!D:\IDE\Anaconda3\envs\Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName: CoreModel.py
 @DateTime: 2025/6/22 14:15
 @SoftWare: PyCharm
 @Author  ：xsh
"""
from PyQt5 import Qt
from datetime import datetime, date
import copy
from sqlalchemy.orm import declarative_base, mapper, sessionmaker, Session
from sqlalchemy.orm import (declarative_base, Mapped, mapped_column, relationship, mapper, sessionmaker)
from sqlalchemy import Table, Engine, create_engine, Column, ForeignKey, and_, or_, insert, delete, update, select, func, ColumnElement,distinct
from sqlalchemy.types import (Text, VARCHAR, REAL, Float, Integer, String, SmallInteger, DateTime, Date, ARRAY,Boolean, JSON)
from sqlalchemy.orm.decl_api import DeclarativeBase, MetaData
from AppUtils.utils import *
from AppCore.Levels import *
from AppInterfaces.utils import *

class CoreModel(DBInterface, DeclarativeBase):

    def __repr__(self) -> str:
        buffer: dict[str, object] = self.DICT_DATA
        return f'{buffer!r}'


    @classmethod
    def instance(cls, **args):
        result: cls = cls.__new__(cls)
        result.__init__(**args)
        return result


    @classmethod
    def Instance(cls, buffer: dict, **args):
        result: cls = cls.__new__(cls)
        result.__init__(**args)
        result.as_field(buffer)
        return result

