Automated Action 43235eb604 Create TechDating API backend
- Setup project structure and basic FastAPI application
- Define database models for users, profiles, matches, and messages
- Set up database connection and create Alembic migrations
- Implement user authentication and registration endpoints
- Create API endpoints for profile management, matches, and messaging
- Add filtering and search functionality for tech profiles
- Setup environment variable configuration
- Create README with project information and setup instructions
2025-05-28 15:17:44 +00:00

19 lines
677 B
Python

from typing import List, Optional
from sqlalchemy.orm import Session
from app.crud.base import CRUDBase
from app.models.profile import Profile
from app.schemas.profile import ProfileCreate, ProfileUpdate
class CRUDProfile(CRUDBase[Profile, ProfileCreate, ProfileUpdate]):
def get_by_user_id(self, db: Session, *, user_id: int) -> Optional[Profile]:
return db.query(Profile).filter(Profile.user_id == user_id).first()
def get_visible_profiles(
self, db: Session, *, skip: int = 0, limit: int = 100
) -> List[Profile]:
return db.query(Profile).filter(Profile.is_visible).offset(skip).limit(limit).all()
profile = CRUDProfile(Profile)