Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
a9844ae2
Commit
a9844ae2
authored
May 31, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added queryparams ids on application endpoints
parent
bc67b379
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
api/urls.py
api/urls.py
+2
-2
api/viewsets/applications.py
api/viewsets/applications.py
+7
-1
config/settings/local.py
config/settings/local.py
+2
-2
No files found.
api/urls.py
View file @
a9844ae2
...
...
@@ -2,7 +2,7 @@ from django.urls import path, include
from
rest_framework.routers
import
DefaultRouter
from
api.viewsets.services
import
APIServiceViewSet
from
api.viewsets.endpoints
import
APIEndpointViewSet
from
api.viewsets.applications
import
ApplicationViewSet
,
GroupDependent
ViewSet
from
api.viewsets.applications
import
ApplicationViewSet
,
MainApplication
ViewSet
from
api.views
import
(
APIGatewayList
,
APIGatewaySlugDetail
,
APIGatewaySlugModelDetail
)
...
...
@@ -11,7 +11,7 @@ router = DefaultRouter()
router
.
register
(
r'applications'
,
ApplicationViewSet
)
router
.
register
(
r'services'
,
APIServiceViewSet
)
router
.
register
(
r'endpoint'
,
APIEndpointViewSet
)
router
.
register
(
r'
group-dependent'
,
GroupDependent
ViewSet
)
router
.
register
(
r'
main-application'
,
MainApplication
ViewSet
)
urlpatterns
=
[
path
(
''
,
include
(
router
.
urls
)),
...
...
api/viewsets/applications.py
View file @
a9844ae2
...
...
@@ -50,11 +50,17 @@ class ApplicationViewSet(viewsets.ModelViewSet):
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
queryset
=
Application
.
objects
.
filter
(
deleted_at__exact
=
None
)
ids
=
self
.
request
.
query_params
.
get
(
'ids'
,
None
)
if
not
queryset
.
exists
():
message
=
status_message_response
(
200
,
'success'
,
'No records found'
,
[]
)
return
Response
(
message
)
if
ids
is
not
None
:
ids
=
ids
.
split
(
','
)
queryset
=
queryset
.
filter
(
id__in
=
ids
)
page
=
self
.
paginate_queryset
(
queryset
)
if
page
is
not
None
:
...
...
@@ -237,7 +243,7 @@ class ApplicationViewSet(viewsets.ModelViewSet):
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
class
GroupDependent
ViewSet
(
viewsets
.
ModelViewSet
):
class
MainApplication
ViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Application
.
objects
.
all
()
serializer_class
=
GroupDependentSerializer
...
...
config/settings/local.py
View file @
a9844ae2
...
...
@@ -32,5 +32,5 @@ DATABASES = {
AUTHENTICATOR_IP
=
config
[
'SERVICE'
][
'AUTHENTICATOR_IP'
]
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/validate-token/'
ACCOUNT_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/a
pplication-dependent
'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/
authenticator-
validate-token/'
ACCOUNT_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/a
uthenticator-group
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment