Skip to content

Commit

Permalink
read palte with analysis with sample (#17)(minor)
Browse files Browse the repository at this point in the history
### Changed
- plates/{id} endpoint returning PlateReadWithAnalyses
- PlateReadWithAnalyses contains AnalysisReadWithSample
  • Loading branch information
mayabrandi authored Jan 31, 2022
1 parent d672d30 commit c7c1fcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions genotype_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ class AnalysisCreate(AnalysisBase):
pass


class SampleBase(SQLModel):
class SampleSlim(SQLModel):
status: Optional[STATUS]
comment: Optional[str]


class SampleBase(SampleSlim):
sex: Optional[SEXES]
created_at: Optional[datetime] = datetime.now()

Expand Down Expand Up @@ -138,8 +141,12 @@ class UserReadWithPlates(UserRead):
plates: Optional[List[Plate]] = []


class AnalysisReadWithSample(AnalysisRead):
sample: Optional[SampleSlim]


class PlateReadWithAnalyses(PlateRead):
analyses: Optional[List[Analysis]] = []
analyses: Optional[List[AnalysisReadWithSample]] = []


class SampleReadWithAnalysis(SampleRead):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_genotype_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "0.2.0"
assert __version__ == "0.3.0"

0 comments on commit c7c1fcb

Please sign in to comment.