Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
beat
beat.web
Commits
6900345a
Commit
6900345a
authored
4 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[experiments][serializers] Replace DRF JSONField with custom version
parent
aa4228e7
No related branches found
No related tags found
1 merge request
!327
Refactor update creation api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/experiments/serializers.py
+5
-4
5 additions, 4 deletions
beat/web/experiments/serializers.py
with
5 additions
and
4 deletions
beat/web/experiments/serializers.py
+
5
−
4
View file @
6900345a
...
@@ -39,6 +39,7 @@ from ..common.serializers import ShareableSerializer
...
@@ -39,6 +39,7 @@ from ..common.serializers import ShareableSerializer
from
..common.utils
import
validate_restructuredtext
from
..common.utils
import
validate_restructuredtext
from
..common.utils
import
annotate_full_name
from
..common.utils
import
annotate_full_name
from
..common.exceptions
import
ContributionCreationError
from
..common.exceptions
import
ContributionCreationError
from
..common
import
fields
as
beat_fields
from
..ui.templatetags.markup
import
restructuredtext
from
..ui.templatetags.markup
import
restructuredtext
...
@@ -51,9 +52,9 @@ from .models import Experiment, Block
...
@@ -51,9 +52,9 @@ from .models import Experiment, Block
class
ExperimentCreationSerializer
(
serializers
.
ModelSerializer
):
class
ExperimentCreationSerializer
(
serializers
.
ModelSerializer
):
declaration
=
serializer
s
.
JSONField
()
declaration
=
beat_field
s
.
JSONField
()
description
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
description
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
fork_of
=
serializer
s
.
JSONField
(
required
=
False
)
fork_of
=
beat_field
s
.
JSONField
(
required
=
False
)
toolchain
=
serializers
.
CharField
()
toolchain
=
serializers
.
CharField
()
class
Meta
:
class
Meta
:
...
@@ -140,7 +141,7 @@ class ExperimentSerializer(ShareableSerializer):
...
@@ -140,7 +141,7 @@ class ExperimentSerializer(ShareableSerializer):
data_read
=
serializers
.
SerializerMethodField
()
data_read
=
serializers
.
SerializerMethodField
()
data_written
=
serializers
.
SerializerMethodField
()
data_written
=
serializers
.
SerializerMethodField
()
description
=
serializers
.
CharField
()
description
=
serializers
.
CharField
()
declaration
=
serializer
s
.
JSONField
()
declaration
=
beat_field
s
.
JSONField
()
class
Meta
:
class
Meta
:
model
=
Experiment
model
=
Experiment
...
@@ -297,7 +298,7 @@ class ExperimentResultsSerializer(ShareableSerializer):
...
@@ -297,7 +298,7 @@ class ExperimentResultsSerializer(ShareableSerializer):
errors
=
serializers
.
SerializerMethodField
()
errors
=
serializers
.
SerializerMethodField
()
html_description
=
serializers
.
SerializerMethodField
()
html_description
=
serializers
.
SerializerMethodField
()
description
=
serializers
.
SerializerMethodField
()
description
=
serializers
.
SerializerMethodField
()
declaration
=
serializer
s
.
JSONField
()
declaration
=
beat_field
s
.
JSONField
()
display_start_date
=
serializers
.
SerializerMethodField
()
display_start_date
=
serializers
.
SerializerMethodField
()
display_end_date
=
serializers
.
SerializerMethodField
()
display_end_date
=
serializers
.
SerializerMethodField
()
...
...
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