
- Complete authentication system with JWT and role-based access control
- User management for Admin, Teacher, Student, and Parent roles
- Student management with CRUD operations
- Class management and assignment system
- Subject and grade tracking functionality
- Daily attendance marking and viewing
- Notification system for announcements
- SQLite database with Alembic migrations
- Comprehensive API documentation with Swagger/ReDoc
- Proper project structure with services, models, and schemas
- Environment variable configuration
- CORS support and security features
🤖 Generated with BackendIM
Co-Authored-By: BackendIM <noreply@anthropic.com>
32 lines
696 B
Python
32 lines
696 B
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
|
|
class GradeBase(BaseModel):
|
|
student_id: int
|
|
subject_id: int
|
|
score: float
|
|
max_score: float = 100.0
|
|
grade_type: str
|
|
description: Optional[str] = None
|
|
|
|
class GradeCreate(GradeBase):
|
|
pass
|
|
|
|
class GradeUpdate(BaseModel):
|
|
score: Optional[float] = None
|
|
max_score: Optional[float] = None
|
|
grade_type: Optional[str] = None
|
|
description: Optional[str] = None
|
|
|
|
class GradeInDBBase(GradeBase):
|
|
id: int
|
|
graded_at: datetime
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
class Grade(GradeInDBBase):
|
|
pass |