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
b2e45259
Commit
b2e45259
authored
Sep 27, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #182 in RMS/api-main-service from gladys-dev2 to RMSv2
* commit '
b55411c9
': list and serializer
parents
b89b537d
b55411c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
app/applicationlayer/cms/form/views.py
app/applicationlayer/cms/form/views.py
+26
-2
app/applicationlayer/cms/template/header/views.py
app/applicationlayer/cms/template/header/views.py
+1
-1
No files found.
app/applicationlayer/cms/form/views.py
View file @
b2e45259
...
...
@@ -34,6 +34,8 @@ from django.forms.models import model_to_dict
import
json
from
django.shortcuts
import
get_object_or_404
from
django.db.models
import
Min
from
app.applicationlayer.utils
import
(
CustomPagination
,
status_message_response
)
APPROVER_MESSAGE
=
settings
.
APPROVER_MESSAGE
...
...
@@ -51,7 +53,8 @@ VENDOR_REJECT_MESSAGE = settings.VENDOR_REJECT_MESSAGE
class
ChangeRequestFormsViewset
(
meviewsets
.
ModelViewSet
):
serializer_class
=
serializers
.
ChangeRequestFormHeaderSerializer
pagination_class
=
paginators
.
SimplePageNumberPagination
# pagination_class = paginators.SimplePageNumberPagination
pagination_class
=
CustomPagination
queryset
=
models
.
ChangeRequestFormHeader
.
objects
.
all
()
lookup_field
=
'form_code'
...
...
@@ -83,7 +86,28 @@ class ChangeRequestFormsViewset(meviewsets.ModelViewSet):
self
.
queryset
=
self
.
queryset
.
order_by
(
'-created'
)
self
.
queryset
=
QuerySetHelper
.
Sort
(
self
)
return
super
(
ChangeRequestFormsViewset
,
self
)
.
list
(
request
)
page
=
self
.
paginate_queryset
(
self
.
queryset
)
if
page
is
not
None
:
serializer
=
self
.
get_serializer
(
page
,
many
=
True
)
message
=
status_message_response
(
200
,
'success'
,
'List of Change Request Form found'
,
serializer
.
data
)
return
self
.
get_paginated_response
(
message
)
serializer
=
self
.
get_serializer
(
self
.
queryset
,
many
=
True
)
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
# return super(ChangeRequestFormsViewset, self).list(request)
@
action
(
detail
=
False
,
methods
=
[
'get'
],
...
...
app/applicationlayer/cms/template/header/views.py
View file @
b2e45259
...
...
@@ -278,7 +278,7 @@ class ChangeRequestTemplatePost(APIView):
sp1
=
transaction
.
savepoint
()
# nothing will save to db
serializer
=
serializers
.
ChangeRequestTemplatesSerializer
(
serializer
=
ChangeRequestTemplatesSerializer
(
data
=
template_header_data
)
if
serializer
.
is_valid
(
raise_exception
=
True
):
...
...
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