CodeBench: deprecated-patterns.md + inline deprecated-säännöt promptissa
Lisätty SQLAlchemy 2.0, Pydantic v2, FastAPI ja Python deprecated → modern patterniparit. Uusimmat dokumentaatiot tarkistettu 2026-04-14.
This commit is contained in:
@@ -25,6 +25,14 @@ OUTPUT FORMAT — use these exact markers to separate files:
|
||||
|
||||
DOCUMENTATION — every file must have a one-line module docstring. Classes get a one-line docstring. Keep it zensical: say what it IS, not what it does. No filler.
|
||||
|
||||
NEVER USE DEPRECATED PATTERNS:
|
||||
- ✗ declarative_base() → ✓ class Base(DeclarativeBase): pass
|
||||
- ✗ Column(Type) → ✓ Mapped[type] = mapped_column(Type)
|
||||
- ✗ class Config: orm_mode = True → ✓ model_config = ConfigDict(from_attributes=True)
|
||||
- ✗ .dict() → ✓ .model_dump()
|
||||
- ✗ Optional[str] → ✓ str | None
|
||||
- ✗ session.query(Model).all() → ✓ session.execute(select(Model)).scalars().all()
|
||||
|
||||
RULES:
|
||||
- Follow the REFERENCE IMPLEMENTATION patterns exactly
|
||||
- SQLAlchemy 2.0: DeclarativeBase + Mapped + mapped_column (not Column())
|
||||
|
||||
Reference in New Issue
Block a user