Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 44dba25

Browse files
committed
generated file: models/base.py
1 parent 3e67879 commit 44dba25

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎models/base.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from sqlalchemy import Column, Integer, String, DateTime, func
2+
from sqlalchemy.ext.declarative import declarative_base
3+
from sqlalchemy.orm import relationship
4+
5+
Base = declarative_base()
6+
7+
class BaseModel(Base):
8+
"""Base model for all database models."""
9+
__abstract__ = True
10+
11+
id = Column(Integer, primary_key=True, index=True)
12+
created_at = Column(DateTime(timezone=True), server_default=func.now())
13+
updated_at = Column(DateTime(timezone=True), onupdate=func.now())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /