Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
AURA
steering
Commits
948b8fcf
Commit
948b8fcf
authored
2 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Clean-up field names.
parent
eb879034
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/serializers.py
+9
-33
9 additions, 33 deletions
program/serializers.py
with
9 additions
and
33 deletions
program/serializers.py
+
9
−
33
View file @
948b8fcf
...
@@ -155,13 +155,9 @@ class UserSerializer(serializers.ModelSerializer):
...
@@ -155,13 +155,9 @@ class UserSerializer(serializers.ModelSerializer):
class
CategorySerializer
(
serializers
.
ModelSerializer
):
class
CategorySerializer
(
serializers
.
ModelSerializer
):
# TODO: remove this when the dashboard is updated
category
=
serializers
.
CharField
(
source
=
"
name
"
)
class
Meta
:
class
Meta
:
model
=
Category
model
=
Category
# TODO: replace `category` with `name` when the dashboard is updated
fields
=
(
"
id
"
,
"
name
"
,
"
subtitle
"
,
"
slug
"
,
"
is_active
"
,
"
description
"
)
fields
=
(
"
id
"
,
"
category
"
,
"
subtitle
"
,
"
slug
"
,
"
is_active
"
,
"
description
"
)
class
HostLinkSerializer
(
serializers
.
ModelSerializer
):
class
HostLinkSerializer
(
serializers
.
ModelSerializer
):
...
@@ -231,43 +227,27 @@ class LanguageSerializer(serializers.ModelSerializer):
...
@@ -231,43 +227,27 @@ class LanguageSerializer(serializers.ModelSerializer):
class
TopicSerializer
(
serializers
.
ModelSerializer
):
class
TopicSerializer
(
serializers
.
ModelSerializer
):
# TODO: remove this when the dashboard is updated
topic
=
serializers
.
CharField
(
source
=
"
name
"
)
class
Meta
:
class
Meta
:
model
=
Topic
model
=
Topic
# TODO: replace `topic` with `name` when the dashboard is updated
fields
=
(
"
id
"
,
"
name
"
,
"
slug
"
,
"
is_active
"
)
fields
=
(
"
id
"
,
"
topic
"
,
"
slug
"
,
"
is_active
"
)
class
MusicFocusSerializer
(
serializers
.
ModelSerializer
):
class
MusicFocusSerializer
(
serializers
.
ModelSerializer
):
# TODO: remove this when the dashboard is updated
focus
=
serializers
.
CharField
(
source
=
"
name
"
)
class
Meta
:
class
Meta
:
model
=
MusicFocus
model
=
MusicFocus
# TODO: replace `focus` with `name` when the dashboard is updated
fields
=
(
"
id
"
,
"
name
"
,
"
slug
"
,
"
is_active
"
)
fields
=
(
"
id
"
,
"
focus
"
,
"
slug
"
,
"
is_active
"
)
class
TypeSerializer
(
serializers
.
ModelSerializer
):
class
TypeSerializer
(
serializers
.
ModelSerializer
):
# TODO: remove this when the dashboard is updated
type
=
serializers
.
CharField
(
source
=
"
name
"
)
class
Meta
:
class
Meta
:
model
=
Type
model
=
Type
# TODO: replace `type` with `name` when the dashboard is updated
fields
=
(
"
id
"
,
"
name
"
,
"
slug
"
,
"
is_active
"
)
fields
=
(
"
id
"
,
"
type
"
,
"
slug
"
,
"
is_active
"
)
class
FundingCategorySerializer
(
serializers
.
ModelSerializer
):
class
FundingCategorySerializer
(
serializers
.
ModelSerializer
):
# TODO: remove this when the dashboard is updated
fundingcategory
=
serializers
.
CharField
(
source
=
"
name
"
)
class
Meta
:
class
Meta
:
model
=
FundingCategory
model
=
FundingCategory
# TODO: replace `fundingcategory` with `name` when the dashboard is updated
fields
=
(
"
id
"
,
"
name
"
,
"
slug
"
,
"
is_active
"
)
fields
=
(
"
id
"
,
"
fundingcategory
"
,
"
slug
"
,
"
is_active
"
)
class
ShowLinkSerializer
(
serializers
.
ModelSerializer
):
class
ShowLinkSerializer
(
serializers
.
ModelSerializer
):
...
@@ -287,16 +267,12 @@ class ShowSerializer(serializers.HyperlinkedModelSerializer):
...
@@ -287,16 +267,12 @@ class ShowSerializer(serializers.HyperlinkedModelSerializer):
queryset
=
Language
.
objects
.
all
(),
many
=
True
queryset
=
Language
.
objects
.
all
(),
many
=
True
)
)
topic
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Topic
.
objects
.
all
(),
many
=
True
)
topic
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Topic
.
objects
.
all
(),
many
=
True
)
# TODO: replace `musicfocs` with `music_focus` and remove the source when the dashboard is
music_focus
=
serializers
.
PrimaryKeyRelatedField
(
# updated
queryset
=
MusicFocus
.
objects
.
all
(),
many
=
True
musicfocus
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
MusicFocus
.
objects
.
all
(),
source
=
"
music_focus
"
,
many
=
True
)
)
type
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Type
.
objects
.
all
())
type
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Type
.
objects
.
all
())
# TODO: replace `fundingcategory` with `funding_category` and remove the source when the
funding_category
=
serializers
.
PrimaryKeyRelatedField
(
# dashboard is updated
queryset
=
FundingCategory
.
objects
.
all
()
fundingcategory
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
FundingCategory
.
objects
.
all
(),
source
=
"
funding_category
"
)
)
predecessor
=
serializers
.
PrimaryKeyRelatedField
(
predecessor
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Show
.
objects
.
all
(),
required
=
False
,
allow_null
=
True
queryset
=
Show
.
objects
.
all
(),
required
=
False
,
allow_null
=
True
...
...
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