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
4388b4dd
Commit
4388b4dd
authored
Sep 27, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing
parent
4f94a74d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2279 additions
and
10 deletions
+2279
-10
app/applicationlayer/cms/template/header/serializers.py
app/applicationlayer/cms/template/header/serializers.py
+19
-8
config/urls.py
config/urls.py
+2
-2
media/uploads/fixed_issue_db
media/uploads/fixed_issue_db
+1129
-0
media/uploads/fixed_issue_db_ubrIVDX
media/uploads/fixed_issue_db_ubrIVDX
+1129
-0
No files found.
app/applicationlayer/cms/template/header/serializers.py
View file @
4388b4dd
from
app.entities
import
models
from
app.entities
import
models
from
rest_framework
import
serializers
from
rest_framework
import
serializers
from
django.db.models
import
Q
from
django.db.models
import
Q
from
django.conf
import
settings
from
django.forms.models
import
model_to_dict
from
django.forms.models
import
model_to_dict
from
drf_writable_nested
import
WritableNestedModelSerializer
from
drf_writable_nested
import
WritableNestedModelSerializer
from
app.applicationlayer.cms.utils_cr
import
(
get_account_details
,
from
app.applicationlayer.cms.utils_cr
import
(
get_account_details
,
...
@@ -15,10 +16,10 @@ from app.applicationlayer.cms.template.stakeholder.serializers import ChangeRequ
...
@@ -15,10 +16,10 @@ from app.applicationlayer.cms.template.stakeholder.serializers import ChangeRequ
class
ChangeRequestTemplateAttachmentsSerializer
(
class
ChangeRequestTemplateAttachmentsSerializer
(
serializers
.
ModelSerializer
serializers
.
ModelSerializer
):
):
file_upload
=
serializers
.
URLField
(
allow_blank
=
True
)
file_upload
=
serializers
.
HyperlinkedRelatedField
(
queryset
=
models
.
MasterAttachment
.
objects
.
all
(),
view_name
=
'MasterAttachment.id'
)
def
to_representation
(
self
,
instance
):
def
to_representation
(
self
,
instance
):
try
:
#
try:
ret
=
super
()
.
to_representation
(
instance
)
ret
=
super
()
.
to_representation
(
instance
)
user_object
=
{
user_object
=
{
"id"
:
instance
.
uploaded_by
.
id
,
"id"
:
instance
.
uploaded_by
.
id
,
...
@@ -29,16 +30,26 @@ class ChangeRequestTemplateAttachmentsSerializer(
...
@@ -29,16 +30,26 @@ class ChangeRequestTemplateAttachmentsSerializer(
"contact_no"
:
instance
.
uploaded_by
.
contact_no
"contact_no"
:
instance
.
uploaded_by
.
contact_no
}
}
ret
[
'uploaded_by'
]
=
user_object
ret
[
'uploaded_by'
]
=
user_object
ret
[
'file_upload'
]
=
instance
.
file_upload
.
url
.
url
# ret['file_upload'] = settings.MEDIA_URL
return
ret
except
Exception
as
e
:
ret
[
'uploaded_by'
]
=
"none"
return
ret
return
ret
# except Exception as e:
# ret['uploaded_by'] = "none"
# return ret
class
Meta
:
class
Meta
:
model
=
models
.
ChangeRequestTemplateAttachments
model
=
models
.
ChangeRequestTemplateAttachments
fields
=
'__all__'
fields
=
(
"id"
,
"attachment_type"
,
"attachment_name"
,
"file_name"
,
"description"
,
"created"
,
"code"
,
"uploaded_by"
,
"file_upload"
,
"template_no"
)
read_only_fields
=
[
'created'
,
'code'
]
read_only_fields
=
[
'created'
,
'code'
]
...
...
config/urls.py
View file @
4388b4dd
...
@@ -35,10 +35,10 @@ urlpatterns = [
...
@@ -35,10 +35,10 @@ urlpatterns = [
url
(
r'^chat/(?P<room_name>[^/]+)/$'
,
notifview
.
room
,
name
=
'room'
),
url
(
r'^chat/(?P<room_name>[^/]+)/$'
,
notifview
.
room
,
name
=
'room'
),
re_path
(
r'^media/(?P<path>.*)$'
,
serve
,{
'document_root'
:
settings
.
MEDIA_ROOT
}),
re_path
(
r'^media/(?P<path>.*)$'
,
serve
,{
'document_root'
:
settings
.
MEDIA_ROOT
}),
re_path
(
r'^static/(?P<path>.*)$'
,
serve
,{
'document_root'
:
settings
.
STATIC_ROOT
}),
#
re_path(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}),
]
]
if
settings
.
DEBUG
:
if
settings
.
DEBUG
:
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
STATIC_URL
,
document_root
=
settings
.
STATIC_ROOT
)
# urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
\ No newline at end of file
\ No newline at end of file
media/uploads/fixed_issue_db
0 → 100644
View file @
4388b4dd
This diff is collapsed.
Click to expand it.
media/uploads/fixed_issue_db_ubrIVDX
0 → 100644
View file @
4388b4dd
This diff is collapsed.
Click to expand it.
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