recopytex/backend/adapters/orm.py

18 lines
360 B
Python

from sqlalchemy import Column, MetaData, String, Table
from sqlalchemy.orm import mapper
from backend.model.tribe import Tribe
metadata = MetaData()
tribes_table = Table(
"tribes",
metadata,
Column("name", String(255), primary_key=True),
Column("level", String(255)),
)
def start_mappers():
tribes_mapper = mapper(Tribe, tribes_table)