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
082c45e7
Commit
082c45e7
authored
Sep 23, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit current user and change the pagination on change request template
parent
dd0f097c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
app/applicationlayer/cms/template/views.py
app/applicationlayer/cms/template/views.py
+23
-4
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+2
-2
No files found.
app/applicationlayer/cms/template/views.py
View file @
082c45e7
...
...
@@ -34,7 +34,7 @@ from app.entities import enums, models
from
django.db.models
import
Q
from
app.applicationlayer.management.account.serializer
import
ChangeRequestList
from
app.applicationlayer.utils
import
log_save
from
app.applicationlayer.utils
import
log_save
,
CustomPagination
from
rest_framework.exceptions
import
ParseError
...
...
@@ -106,14 +106,33 @@ class ChangeRequestTemplatesViewset(meviewsets.ModelViewSet):
queryset
=
models
.
ChangeRequestTemplateHeader
.
objects
.
all
()
lookup_field
=
'template_no'
serializer_class
=
serializers
.
ChangeRequestTemplatesSerializer
pagination_class
=
paginators
.
SimplePageNumber
Pagination
pagination_class
=
Custom
Pagination
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
queryset
=
self
.
queryset
.
order_by
(
'-created'
)
self
.
queryset
=
QuerySetHelper
.
Sort
(
self
)
return
super
(
ChangeRequestTemplatesViewset
,
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 Templates 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
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
queryset
.
filter
(
...
...
@@ -223,7 +242,7 @@ class ChangeRequestTemplatesViewset(meviewsets.ModelViewSet):
"Unable to edit due to existing transaction"
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
@
action
(
methods
=
[
'PATCH'
],
detail
=
True
,
url_path
=
'archived'
,
url_name
=
'archived'
...
...
app/applicationlayer/management/user/serializers.py
View file @
082c45e7
...
...
@@ -125,8 +125,8 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
name__icontains
=
"user"
)
mod
=
mod
.
exclude
(
parent
=
0
)
#
mod = mod.exclude(parent=0)
mod
=
ModuleSerializer
(
data
=
mod
,
many
=
True
)
mod
.
is_valid
()
...
...
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