Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
StorageLeaf
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ProjectLeaf
StorageLeaf
Commits
6b913448
Commit
6b913448
authored
4 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
enforce a min length of 1 for device names, sensor names, sensor types and measurement values
parent
6af7341e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/logic/database/Schemas.py
+7
-7
7 additions, 7 deletions
src/logic/database/Schemas.py
with
7 additions
and
7 deletions
src/logic/database/Schemas.py
+
7
−
7
View file @
6b913448
from
typing
import
List
from
pydantic
import
BaseModel
from
pydantic
import
BaseModel
,
Field
# ===== special =====
...
...
@@ -41,7 +41,7 @@ class Measurement(BaseModel):
class
MeasurementCreate
(
BaseModel
):
value
:
str
value
:
str
=
Field
(...,
min_length
=
1
)
sensorId
:
int
...
...
@@ -56,14 +56,14 @@ class SensorBase(BaseModel):
class
SensorCreate
(
BaseModel
):
name
:
str
type
:
str
name
:
str
=
Field
(...,
min_length
=
1
)
type
:
str
=
Field
(...,
min_length
=
1
)
deviceId
:
int
class
SensorUpdate
(
BaseModel
):
name
:
str
type
:
str
name
:
str
=
Field
(...,
min_length
=
1
)
type
:
str
=
Field
(...,
min_length
=
1
)
class
Sensor
(
SensorBase
):
...
...
@@ -87,7 +87,7 @@ class Device(BaseModel):
class
DeviceCreate
(
BaseModel
):
name
:
str
name
:
str
=
Field
(...,
min_length
=
1
)
# ===== send multiple measurements =====
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment