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
dfbe1cfd
Commit
dfbe1cfd
authored
Oct 15, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new field attch_ref to allow upload same file name on attachment
parent
6bfa644b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
app/applicationlayer/master/attachment/views.py
app/applicationlayer/master/attachment/views.py
+7
-4
app/entities/migrations/0020_masterattachment_attch_ref.py
app/entities/migrations/0020_masterattachment_attch_ref.py
+19
-0
app/entities/models.py
app/entities/models.py
+1
-0
No files found.
app/applicationlayer/master/attachment/views.py
View file @
dfbe1cfd
...
...
@@ -40,14 +40,17 @@ class MasterAttachmentViewSet(viewsets.ModelViewSet):
@
transaction
.
atomic
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
attachments
=
[]
for
instance
in
self
.
request
.
data
.
getlist
(
'url'
)
:
for
instance
in
self
.
request
.
data
:
body
=
{}
data
=
MasterAttachment
.
objects
.
create
(
url
=
instance
)
data
=
MasterAttachment
.
objects
.
create
(
url
=
instance
,
attch_ref
=
str
(
request
.
data
[
instance
])
)
file_name
=
str
(
data
.
url
)
.
split
(
'/'
)
body
[
'id'
]
=
data
.
id
body
[
'file_name'
]
=
instance
.
name
body
[
'file_name'
]
=
str
(
request
.
data
[
instance
])
body
[
'attch_ref'
]
=
instance
attachments
.
append
(
body
)
return
Response
(
...
...
app/entities/migrations/0020_masterattachment_attch_ref.py
0 → 100644
View file @
dfbe1cfd
# Generated by Django 2.2 on 2019-10-15 18:29
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0019_auto_20191015_1721'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'masterattachment'
,
name
=
'attch_ref'
,
field
=
models
.
TextField
(
default
=
1
),
preserve_default
=
False
,
),
]
app/entities/models.py
View file @
dfbe1cfd
...
...
@@ -448,6 +448,7 @@ class MasterAttachment(models.Model):
upload_to
=
'uploads/'
,
blank
=
True
,
null
=
True
)
attch_ref
=
models
.
TextField
()
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