docs: add AI code generation requirements and comprehensive Google-style docstrings
- Add AI code generation requirements to AGENTS.md - Add module-level docstrings to all 46 Python modules - Add detailed Google-style docstrings to all classes and functions - Remove all inline comments following self-documenting code principle - Include Args, Returns, Raises sections in function docstrings - Add Attributes and Examples sections to class docstrings
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
"""SQLAlchemy ORM models."""
|
||||
"""SQLAlchemy ORM models.
|
||||
|
||||
This module defines the database ORM models that map to database tables.
|
||||
Models are used by repositories for data persistence.
|
||||
"""
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from uuid import uuid4
|
||||
@@ -10,7 +14,25 @@ Base = declarative_base()
|
||||
|
||||
|
||||
class PostORM(Base): # type: ignore[valid-type,misc]
|
||||
"""SQLAlchemy model for Blog Post."""
|
||||
"""SQLAlchemy model for Blog Post.
|
||||
|
||||
Database table representation of blog posts.
|
||||
Maps to the 'posts' table with all post attributes.
|
||||
|
||||
Attributes:
|
||||
id: Primary key as UUID string.
|
||||
title: Post title (max 200 chars).
|
||||
content: Post content (text).
|
||||
slug: URL-friendly unique identifier.
|
||||
author_id: Author reference.
|
||||
published: Publication status flag.
|
||||
tags: JSON array of tags.
|
||||
created_at: Creation timestamp.
|
||||
updated_at: Last update timestamp.
|
||||
|
||||
Example:
|
||||
>>> post = PostORM(title="Post", content="...", slug="post", author_id="user-1")
|
||||
"""
|
||||
|
||||
__tablename__ = "posts"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user