import uuid
from datetime import datetime
from typing import Optional

from pydantic import UUID4
from sqlmodel import Field, SQLModel


class DocumentInput(SQLModel):
    id: UUID4 = Field(default_factory=uuid.uuid4, primary_key=True)
    content: str


class Document(DocumentInput, table=True):
    created_at: datetime = Field(default_factory=datetime.utcnow)
    updated_at: datetime = Field(default_factory=datetime.utcnow)
    category: Optional[str] = Field(default=None)

sqlmodel.Field
[((184, 235), 'sqlmodel.Field', 'Field', ([], {'default_factory': 'uuid.uuid4', 'primary_key': '(True)'}), '(default_factory=uuid.uuid4, primary_key=True)\n', (189, 235), False, 'from sqlmodel import Field, SQLModel\n'), ((325, 363), 'sqlmodel.Field', 'Field', ([], {'default_factory': 'datetime.utcnow'}), '(default_factory=datetime.utcnow)\n', (330, 363), False, 'from sqlmodel import Field, SQLModel\n'), ((391, 429), 'sqlmodel.Field', 'Field', ([], {'default_factory': 'datetime.utcnow'}), '(default_factory=datetime.utcnow)\n', (396, 429), False, 'from sqlmodel import Field, SQLModel\n'), ((460, 479), 'sqlmodel.Field', 'Field', ([], {'default': 'None'}), '(default=None)\n', (465, 479), False, 'from sqlmodel import Field, SQLModel\n')]