- Fixed main.py to include all route routers (posts, users, comments, feed) - Renamed app/models.py to app/schemas.py and split into proper schema modules - Fixed schema imports in routes - Updated app/models/__init__.py to properly export SQLAlchemy models - Fixed database imports in route files - App imports and runs correctly
21 lines
454 B
Python
21 lines
454 B
Python
"""User schemas for SocialPhoto API."""
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
"""Base user model."""
|
|
username: str
|
|
email: str
|
|
avatar_url: Optional[str] = "/static/default-avatar.png"
|
|
bio: Optional[str] = ""
|
|
|
|
|
|
class UserStats(BaseModel):
|
|
"""User statistics model."""
|
|
posts_count: int
|
|
followers_count: int
|
|
following_count: int
|