Phase 5: Simple mode entity templates#8
Merged
Conversation
9 Jinja2 templates that generate per-entity code: - model.py.j2 — SQLAlchemy model with enums, FKs, relationships, TYPE_CHECKING imports, all 13 field types - schema.py.j2 — Pydantic v2 Create/Update/Response/DetailResponse with nested relationships and audit fields - repository.py.j2 — extends SqlAlchemyRepository, optional search() - service.py.j2 — extends CrudService with lifecycle hook stubs - router.py.j2 — FastAPI CRUD endpoints with query param filtering - factory.py.j2 — polyfactory ModelFactory - fake_repository.py.j2 — in-memory dict-based Protocol implementation - test_unit_service.py.j2 — service tests with fake repository - test_integration.py.j2 — API endpoint test stubs 56 new tests (337 total) verifying: - All 9 templates render valid Python for User/Post/Category/Tag entities - Cross-template consistency (names, imports, classes) - Model: tablename, base class, enums, FKs, relationships - Schema: four classes, required fields, response ID - Repository: inherits SqlAlchemyRepository, conditional search - All templates handle minimal entities (single field) cleanly Part of Phase 5 in #1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
9 Jinja2 entity templates that generate per-entity code:
Test coverage
56 new tests (337 total) — every template renders valid Python for 4 entity types (User, Post, Category, minimal Tag)
How to test
make check # 337 tests passPart of
Phase 5 in #1 — After this merges, Phase 6 (CLI commands) is the final phase.
🤖 Generated with Claude Code