Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Agents

## Rules

- We aim to generate a bare usable minimum. Do not include example models, placeholder data, or unnecessary boilerplate that the user would have to delete.
15 changes: 2 additions & 13 deletions fastapi/31-sqlalchemy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,9 @@ async def get_db():
await session.close()
EOF

# Create example model
# Create models module
cat > "$FASTAPI_PROJECT_NAME/models.py" <<EOF
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column

from .database import Base


class Item(Base):
__tablename__ = "items"

id: Mapped[int] = mapped_column(primary_key=True, index=True)
name: Mapped[str] = mapped_column(String, index=True)
description: Mapped[str | None] = mapped_column(String, nullable=True)
from .database import Base # noqa: F401
EOF

poetry run isort .
Expand Down
13 changes: 1 addition & 12 deletions fastapi/example/example/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column

from .database import Base


class Item(Base):
__tablename__ = "items"

id: Mapped[int] = mapped_column(primary_key=True, index=True)
name: Mapped[str] = mapped_column(String, index=True)
description: Mapped[str | None] = mapped_column(String, nullable=True)
from .database import Base # noqa: F401
Loading