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
2a6d12cf
Commit
2a6d12cf
authored
Sep 28, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #200 in RMS/api-main-service from gladys-dev2 to RMSv2
* commit '
819c1c73
': object
parents
52f0edae
819c1c73
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
73 additions
and
10 deletions
+73
-10
app/applicationlayer/cms/form/approver/views.py
app/applicationlayer/cms/form/approver/views.py
+6
-1
app/applicationlayer/cms/form/attachment/serializers.py
app/applicationlayer/cms/form/attachment/serializers.py
+3
-1
app/applicationlayer/cms/form/attachment/views.py
app/applicationlayer/cms/form/attachment/views.py
+6
-1
app/applicationlayer/cms/form/details/views.py
app/applicationlayer/cms/form/details/views.py
+5
-0
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+0
-5
app/applicationlayer/cms/form/stakeholder/views.py
app/applicationlayer/cms/form/stakeholder/views.py
+5
-0
app/applicationlayer/cms/template/approver/views.py
app/applicationlayer/cms/template/approver/views.py
+5
-0
app/applicationlayer/cms/template/attachment/views.py
app/applicationlayer/cms/template/attachment/views.py
+5
-0
app/applicationlayer/cms/template/details/views.py
app/applicationlayer/cms/template/details/views.py
+5
-0
app/applicationlayer/cms/template/header/serializers.py
app/applicationlayer/cms/template/header/serializers.py
+27
-1
app/applicationlayer/cms/template/stakeholder/views.py
app/applicationlayer/cms/template/stakeholder/views.py
+5
-0
app/entities/models.py
app/entities/models.py
+1
-1
No files found.
app/applicationlayer/cms/form/approver/views.py
View file @
2a6d12cf
...
...
@@ -50,4 +50,9 @@ class ChangeRequestFormApproversViewset(viewsets.ModelViewSet):
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
\ No newline at end of file
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/applicationlayer/cms/form/attachment/serializers.py
View file @
2a6d12cf
...
...
@@ -18,10 +18,12 @@ class ChangeRequestFormAttachmentsSerializer(
"contact_no"
:
instance
.
uploaded_by
.
contact_no
}
ret
[
'uploaded_by'
]
=
user_object
ret
[
'file_upload'
]
=
self
.
context
[
'request'
]
.
build_absolute_uri
(
instance
.
file_upload
.
url
.
url
)
ret
[
'file_upload'
]
=
self
.
context
[
'request'
]
.
build_absolute_uri
(
instance
.
file_upload
.
url
.
url
)
return
ret
except
Exception
as
e
:
ret
[
'uploaded_by'
]
=
"none"
ret
[
'file_upload'
]
=
"none"
return
ret
class
Meta
:
...
...
app/applicationlayer/cms/form/attachment/views.py
View file @
2a6d12cf
...
...
@@ -47,4 +47,9 @@ class ChangeRequestFormAttachmentsViewset(viewsets.ModelViewSet):
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
\ No newline at end of file
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/applicationlayer/cms/form/details/views.py
View file @
2a6d12cf
...
...
@@ -47,3 +47,8 @@ class ChangeRequestFormDetailsViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
app/applicationlayer/cms/form/header/views.py
View file @
2a6d12cf
...
...
@@ -363,11 +363,6 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
# instance = self.queryset.filter(
# form_code=str(self.kwargs.get('form_code'))
# ).first()
# serializer = self.get_serializer(instance)
# return Response(serializer.data)
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
...
...
app/applicationlayer/cms/form/stakeholder/views.py
View file @
2a6d12cf
...
...
@@ -49,3 +49,8 @@ class ChangeRequestFormStakeHoldersViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/applicationlayer/cms/template/approver/views.py
View file @
2a6d12cf
...
...
@@ -51,3 +51,8 @@ class ChangeRequestTemplateApproversViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/applicationlayer/cms/template/attachment/views.py
View file @
2a6d12cf
...
...
@@ -50,3 +50,8 @@ class ChangeRequestTemplateAttachmentsViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/applicationlayer/cms/template/details/views.py
View file @
2a6d12cf
...
...
@@ -48,3 +48,8 @@ class ChangeRequestTemplateDetailsViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
app/applicationlayer/cms/template/header/serializers.py
View file @
2a6d12cf
...
...
@@ -32,6 +32,19 @@ class ChangeRequestTemplatesSerializer(
def
to_representation
(
self
,
instance
):
ret
=
super
()
.
to_representation
(
instance
)
try
:
requested_to_user_object
=
{
"id"
:
instance
.
requested_to_user
.
id
,
"name"
:
instance
.
requested_to_user
.
name
,
"username"
:
instance
.
requested_to_user
.
username
,
"code"
:
instance
.
requested_to_user
.
code
,
"email"
:
instance
.
requested_to_user
.
email
,
"contact_no"
:
instance
.
requested_to_user
.
contact_no
}
ret
[
'requested_to_company_object'
]
=
model_to_dict
(
instance
.
requested_to_company
)
ret
[
'requested_to_department_object'
]
=
model_to_dict
(
instance
.
requested_to_department
)
ret
[
'requested_to_user_object'
]
=
requested_to_user_object
ret
[
'company'
]
=
instance
.
requested_to_company
.
name
ret
[
'department'
]
=
instance
.
requested_to_department
.
name
...
...
@@ -70,7 +83,20 @@ class ChangeRequestTemplatesSerializerList(
def
to_representation
(
self
,
instance
):
ret
=
super
()
.
to_representation
(
instance
)
try
:
requested_to_user_object
=
{
"id"
:
instance
.
requested_to_user
.
id
,
"name"
:
instance
.
requested_to_user
.
name
,
"username"
:
instance
.
requested_to_user
.
username
,
"code"
:
instance
.
requested_to_user
.
code
,
"email"
:
instance
.
requested_to_user
.
email
,
"contact_no"
:
instance
.
requested_to_user
.
contact_no
}
ret
[
'requested_to_company_object'
]
=
model_to_dict
(
instance
.
requested_to_company
)
ret
[
'requested_to_department_object'
]
=
model_to_dict
(
instance
.
requested_to_department
)
ret
[
'requested_to_user_object'
]
=
requested_to_user_object
ret
[
'company'
]
=
instance
.
requested_to_company
.
name
ret
[
'department'
]
=
instance
.
requested_to_department
.
name
ret
[
'point_of_contact'
]
=
instance
.
requested_to_user
.
name
...
...
app/applicationlayer/cms/template/stakeholder/views.py
View file @
2a6d12cf
...
...
@@ -51,3 +51,8 @@ class ChangeRequestTemplateStakeholdersViewset(viewsets.ModelViewSet):
serializer
.
data
,
status
=
status
.
HTTP_200_OK
)
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
serializer
=
self
.
get_serializer
(
instance
)
return
Response
(
serializer
.
data
)
\ No newline at end of file
app/entities/models.py
View file @
2a6d12cf
...
...
@@ -442,7 +442,7 @@ class MasterAttachment(models.Model):
upload_to
=
'uploads/'
,
blank
=
True
,
null
=
True
)
class
Meta
:
db_table
=
'master_attachments'
...
...
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