mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 02:06:47 +00:00
12 lines
267 B
Python
12 lines
267 B
Python
from sqlalchemy.ext.declarative import declarative_base, declared_attr
|
|
|
|
|
|
class CustomBase(object):
|
|
# Generate __tablename__ automatically
|
|
@declared_attr
|
|
def __tablename__(cls):
|
|
return cls.__name__.lower()
|
|
|
|
|
|
Base = declarative_base(cls=CustomBase)
|