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
f1dff13b
Commit
f1dff13b
authored
3 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Make ActiveInactiveMixin a ActiveInactiveViewSet
parent
cc8b4252
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/views.py
+8
-8
8 additions, 8 deletions
program/views.py
with
8 additions
and
8 deletions
program/views.py
+
8
−
8
View file @
f1dff13b
...
...
@@ -851,7 +851,7 @@ class APINoteViewSet(viewsets.ModelViewSet):
return
Response
(
status
=
status
.
HTTP_401_UNAUTHORIZED
)
class
ActiveInactive
Mixin
:
class
ActiveInactive
ViewSet
(
viewsets
.
ModelViewSet
)
:
permission_classes
=
[
permissions
.
DjangoModelPermissionsOrAnonReadOnly
]
def
get_queryset
(
self
:
viewsets
.
ModelViewSet
):
...
...
@@ -866,7 +866,7 @@ class ActiveInactiveMixin:
return
self
.
queryset
.
model
.
objects
.
all
()
class
APICategoryViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APICategoryViewSet
(
ActiveInactiveViewSet
):
"""
/categories/ returns all categories (GET, POST)
/categories/?active=true returns all active categories (GET)
...
...
@@ -878,7 +878,7 @@ class APICategoryViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
CategorySerializer
class
APITypeViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APITypeViewSet
(
ActiveInactiveViewSet
):
"""
/types/ returns all types (GET, POST)
/types/?active=true returns all active types (GET)
...
...
@@ -890,7 +890,7 @@ class APITypeViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
TypeSerializer
class
APITopicViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APITopicViewSet
(
ActiveInactiveViewSet
):
"""
/topics/: Returns all topics (GET, POST)
/topics/?active=true Returns all active topics (GET)
...
...
@@ -902,7 +902,7 @@ class APITopicViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
TopicSerializer
class
APIMusicFocusViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APIMusicFocusViewSet
(
ActiveInactiveViewSet
):
"""
/musicfocus/ returns all music focuses (GET, POST)
/musicfocus/?active=true: returns all active music focuses (GET)
...
...
@@ -914,7 +914,7 @@ class APIMusicFocusViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
MusicFocusSerializer
class
APIFundingCategoryViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APIFundingCategoryViewSet
(
ActiveInactiveViewSet
):
"""
/fundingcategories/: returns all funding categories (GET, POST)
/fundingcategories/?active=true returns all active funding categories (GET)
...
...
@@ -926,7 +926,7 @@ class APIFundingCategoryViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
FundingCategorySerializer
class
APILanguageViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APILanguageViewSet
(
ActiveInactiveViewSet
):
"""
/languages/ returns all languages (GET, POST)
/languages/?active=true returns all active languages (GET)
...
...
@@ -938,7 +938,7 @@ class APILanguageViewSet(ActiveInactiveMixin, viewsets.ModelViewSet):
serializer_class
=
LanguageSerializer
class
APIHostViewSet
(
ActiveInactive
Mixin
,
viewsets
.
Model
ViewSet
):
class
APIHostViewSet
(
ActiveInactiveViewSet
):
"""
/hosts/ returns all hosts (GET, POST)
/hosts/?active=true returns all active hosts (GET)
...
...
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