recopytex/backend/adapters/orm.py

18 lines
360 B
Python
Raw Normal View History

2022-12-20 09:25:12 +00:00
from sqlalchemy import Column, MetaData, String, Table
from sqlalchemy.orm import mapper
2022-12-21 05:53:27 +00:00
from backend.model.tribe import Tribe
2022-12-20 09:25:12 +00:00
metadata = MetaData()
2022-12-21 05:53:27 +00:00
tribes_table = Table(
2022-12-20 09:25:12 +00:00
"tribes",
metadata,
Column("name", String(255), primary_key=True),
Column("level", String(255)),
)
def start_mappers():
2022-12-21 05:53:27 +00:00
tribes_mapper = mapper(Tribe, tribes_table)