Add Project schema
This commit is contained in:
parent
be8f326e61
commit
68074d8a22
43
schemas/project.py
Normal file
43
schemas/project.py
Normal file
@ -0,0 +1,43 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
class ProjectBase(BaseModel):
|
||||
title: str = Field(..., max_length=255, description="Project title")
|
||||
description: str = Field(..., description="Project description")
|
||||
student_name: str = Field(..., max_length=100, description="Name of the student")
|
||||
supervisor_name: str = Field(..., max_length=100, description="Name of the supervisor")
|
||||
department: str = Field(..., max_length=100, description="Department name")
|
||||
year: int = Field(..., description="Project year")
|
||||
status: str = Field(..., max_length=50, description="Project status")
|
||||
technologies_used: str = Field(..., max_length=255, description="Technologies used in the project")
|
||||
github_link: str = Field(..., max_length=255, description="GitHub repository link")
|
||||
documentation_link: str = Field(..., max_length=255, description="Documentation link")
|
||||
grade: str = Field(..., max_length=10, description="Project grade")
|
||||
|
||||
class ProjectCreate(ProjectBase):
|
||||
class Config:
|
||||
schema_extra = {
|
||||
"example": {
|
||||
"title": "AI-Powered Chat Application",
|
||||
"description": "A real-time chat application using artificial intelligence",
|
||||
"student_name": "John Doe",
|
||||
"supervisor_name": "Dr. Jane Smith",
|
||||
"department": "Computer Science",
|
||||
"year": 2023,
|
||||
"status": "Completed",
|
||||
"technologies_used": "Python, FastAPI, React, TensorFlow",
|
||||
"github_link": "https://github.com/johndoe/ai-chat",
|
||||
"documentation_link": "https://docs.ai-chat.com",
|
||||
"grade": "A"
|
||||
}
|
||||
}
|
||||
|
||||
class Project(ProjectBase):
|
||||
id: int
|
||||
is_published: bool = False
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
Loading…
x
Reference in New Issue
Block a user