first commit
This commit is contained in:
6
models/__init__.py
Normal file
6
models/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
"""SQLAlchemy ORM 模型包
|
||||
|
||||
存放项目中使用到的SQLAlchemy模型。当前主要通过运行时创建与查询,
|
||||
如需持久化ORM模型可在此处新增。
|
||||
"""
|
||||
|
||||
16
models/base.py
Normal file
16
models/base.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""SQLAlchemy Base 定义与示例模型
|
||||
|
||||
提供 SQLAlchemy 的 Base 供后续 ORM 模型继承。
|
||||
"""
|
||||
|
||||
from sqlalchemy.orm import declarative_base
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
# 示例:如需添加ORM模型,可参考以下结构
|
||||
# from sqlalchemy import Column, Integer, String
|
||||
# class User(Base):
|
||||
# __tablename__ = "users"
|
||||
# id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
# name = Column(String(100), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user