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
498f0503
Commit
498f0503
authored
Oct 15, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added serializer data to attachment
parent
8dda9d48
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app/applicationlayer/cms/form/attachment/serializers.py
app/applicationlayer/cms/form/attachment/serializers.py
+5
-2
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+8
-1
No files found.
app/applicationlayer/cms/form/attachment/serializers.py
View file @
498f0503
...
@@ -36,12 +36,15 @@ class ChangeRequestFormAttachmentsFileUploadSerializer(
...
@@ -36,12 +36,15 @@ class ChangeRequestFormAttachmentsFileUploadSerializer(
class
Meta
:
class
Meta
:
model
=
models
.
ChangeRequestFormAttachments
model
=
models
.
ChangeRequestFormAttachments
fields
=
(
fields
=
(
'id'
,
'code'
,
'attachment_type'
,
'attachment_type'
,
'attachment_name'
,
'attachment_name'
,
'file_name'
,
'file_name'
,
'description'
,
'description'
,
'file_upload'
,
'file_upload'
,
'uploaded_by'
,
'uploaded_by'
,
'form_code'
'form_code'
,
'created'
)
)
# read_only_fields = ['created', 'code']
read_only_fields
=
[
'id,'
,
'created'
,
'code'
]
\ No newline at end of file
\ No newline at end of file
app/applicationlayer/cms/form/header/views.py
View file @
498f0503
...
@@ -1294,11 +1294,18 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
...
@@ -1294,11 +1294,18 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
id_number
id_number
)
)
self
.
queryset
=
models
.
ChangeRequestFormAttachments
.
objects
.
filter
(
form_code
=
form_code
)
self
.
serializer_class
=
ChangeRequestFormAttachmentsFileUploadSerializer
serializer
=
self
.
get_serializer
(
self
.
queryset
,
many
=
True
)
message
=
status_message_response
(
message
=
status_message_response
(
200
,
'success'
,
200
,
'success'
,
'Attachments successfully updated!'
,
'Attachments successfully updated!'
,
''
serializer
.
data
)
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
...
...
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