Skip to content

Commit

Permalink
Optional field in schemas updated with None value in default
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 6, 2023
1 parent 0f5014d commit 0a2e52c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ class BETAProjectUpload(BaseModel):
xform_title: Union[str, None]
odk_central: ODKCentral
hashtags: Union[List[str], None]
organisation_id: Optional[int]
organisation_id: Optional[int] = None
# city: str
# country: str


class Feature(BaseModel):
id: int
project_id: int
task_id: Optional[int]
geometry: Optional[Feature]
task_id: Optional[int] = None
geometry: Optional[Feature] = None


class ProjectSummary(BaseModel):
id: int = -1
priority: ProjectPriority = ProjectPriority.MEDIUM
priority_str: str = priority.name
title: Optional[str]
location_str: Optional[str]
description: Optional[str]
total_tasks: Optional[int]
tasks_mapped: Optional[int]
num_contributors: Optional[int]
tasks_validated: Optional[int]
tasks_bad: Optional[int]
hashtags: Optional[List[str]]
organisation_id: Optional[int]
organisation_logo: Optional[str]
title: Optional[str] = None
location_str: Optional[str] = None
description: Optional[str] = None
total_tasks: Optional[int] = None
tasks_mapped: Optional[int] = None
num_contributors: Optional[int] = None
tasks_validated: Optional[int] = None
tasks_bad: Optional[int] = None
hashtags: Optional[List[str]] = None
organisation_id: Optional[int] = None
organisation_logo: Optional[str] = None


class ProjectBase(BaseModel):
Expand All @@ -88,9 +88,9 @@ class ProjectBase(BaseModel):
# location_str: str
# outline_geojson: Optional[Feature]
project_tasks: Optional[List[tasks_schemas.Task]]
xform_title: Optional[str]
hashtags: Optional[List[str]]
organisation_id: Optional[int]
xform_title: Optional[str] = None
hashtags: Optional[List[str]] = None
organisation_id: Optional[int] = None


class ProjectOut(ProjectBase):
Expand Down

0 comments on commit 0a2e52c

Please sign in to comment.