
- Set up project structure with FastAPI application - Implement SQLAlchemy models for users, services, projects, team members, contacts - Create API endpoints for website functionality - Implement JWT authentication system with user roles - Add file upload functionality for media - Configure CORS and health check endpoints - Add database migrations with Alembic - Create comprehensive README with setup instructions
24 lines
1.2 KiB
Python
24 lines
1.2 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from sqlalchemy import Boolean, DateTime, Integer, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class TeamMember(Base):
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True)
|
|
name: Mapped[str] = mapped_column(String(100), nullable=False, index=True)
|
|
position: Mapped[str] = mapped_column(String(100), nullable=False)
|
|
bio: Mapped[Optional[str]] = mapped_column(Text)
|
|
photo: Mapped[Optional[str]] = mapped_column(String(255))
|
|
email: Mapped[Optional[str]] = mapped_column(String(100))
|
|
linkedin: Mapped[Optional[str]] = mapped_column(String(255))
|
|
twitter: Mapped[Optional[str]] = mapped_column(String(255))
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
order: Mapped[int] = mapped_column(Integer, default=0)
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
|
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime,
|
|
default=datetime.utcnow,
|
|
onupdate=datetime.utcnow) |