from sqlite3.dbapi2 import Timestamp, adapt
from typing import Optional
from sqlmodel import Field, SQLModel
from pydantic import validator
from datetime import datetime, date


class Rate(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    user_id: int = Field(foreign_key="user.id")
    client_id: int = Field(foreign_key="client.id")
    valid_from: date
    valid_to: date
    amount: float  # currency: EUR
    created_at: datetime
    updated_at: datetime
    is_active: bool

sqlmodel.Field
[((236, 273), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (241, 273), False, 'from sqlmodel import Field, SQLModel\n'), ((293, 321), 'sqlmodel.Field', 'Field', ([], {'foreign_key': '"""user.id"""'}), "(foreign_key='user.id')\n", (298, 321), False, 'from sqlmodel import Field, SQLModel\n'), ((343, 373), 'sqlmodel.Field', 'Field', ([], {'foreign_key': '"""client.id"""'}), "(foreign_key='client.id')\n", (348, 373), False, 'from sqlmodel import Field, SQLModel\n')]