18 lines
495 B
Python
18 lines
495 B
Python
from ..extensions import db
|
|
from datetime import datetime
|
|
|
|
|
|
class BaseModel(db.Model):
|
|
"""所有模型的基礎類,提供共同的欄位和功能"""
|
|
__abstract__ = True
|
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
created_at = db.Column(db.DateTime, default=datetime.now)
|
|
updated_at = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now)
|
|
|
|
from .product import Product
|
|
from .transaction import Transaction
|
|
|
|
__all__ = ['BaseModel', 'Product', 'Transaction']
|
|
|