File tree 1 file changed +6
-19
lines changed
1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change 1
1
import datetime
2
- from pydantic import BaseModel
2
+ from pydantic import BaseModel , Field
3
3
from .page import Page
4
4
from src .utilities .metaclass import Partial
5
5
6
6
class SampleBase (BaseModel ):
7
7
"Base class for all Sample schemas, for internal use only"
8
-
9
- name : str
10
- "Name / Label"
11
-
12
- date : datetime .datetime
13
- "Date collected"
14
-
15
- type : str
16
- "Type of experiment"
8
+ name : str = Field (default = None , title = "Name / Label" , max_length = 300 )
9
+ date : datetime .datetime = Field (default = None , title = "Date collected" )
10
+ type : str = Field (default = None , title = "Type of experiment" , max_length = 300 )
17
11
18
12
19
13
class Sample (SampleBase ):
20
14
"Sample existing in the database"
21
-
22
- id : int
23
- "Unique identifier"
24
-
25
- file_name : str | None
15
+ id : int = Field (title = "Unique identifier" )
16
+ file_name : str | None = Field (default = None , title = "Stored filename (with extension), A null value means no file is currently attached to the sample." )
26
17
"""
27
- Stored filename (with extension).
28
-
29
- A null value means no file is currently attached to the sample.
30
18
Evolution:
31
19
we might have a file table in the future to hide the real name and store the user's file name, and extension
32
20
"""
33
21
34
-
35
22
SampleCreate = SampleBase # Simple alias
36
23
"Minimal data to create a new Sample"
37
24
You can’t perform that action at this time.
0 commit comments