/
ruslanf
/
table_reservation_api
Обзор
Документация
Войти
/
ruslanf
/
table_reservation_api
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
models/table.py
12 строк
418 B
Ruslan Fatkulin
crud
15 апр 2025, 11:21
15 апр 2025, 11:21
1dea426
Код
Авторство
О чём код?
from enum import Enum from sqlmodel import SQLModel, Field, Relationship from typing import List from . import Reservation class Table(SQLModel, table=True): __tablename__ = 'tables' id: int = Field(default=None, primary_key=True) name: str = Field(max_length=15, unique=True) seats: int = Field(ge=1, le=6) location: str reservations: List[Reservation] = Relationship(back_populates='table')