Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
71726083
authored
Jul 23, 2019
by
Bodor Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add intarface data fields to serializer
parent
b059943e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
recircle/image/serializers.py
+10
-2
No files found.
recircle/image/serializers.py
View file @
71726083
...
@@ -3,9 +3,15 @@ from rest_framework import serializers
...
@@ -3,9 +3,15 @@ from rest_framework import serializers
from
.models
import
Image
from
.models
import
Image
class
ImageUpdateSerializer
(
serializers
.
Serializer
):
name
=
serializers
.
CharField
(
required
=
False
)
description
=
serializers
.
CharField
(
required
=
False
)
class
ImageSerializer
(
serializers
.
ModelSerializer
):
class
ImageSerializer
(
serializers
.
ModelSerializer
):
image_file
=
serializers
.
FileField
(
write_only
=
True
)
image_file
=
serializers
.
FileField
(
write_only
=
True
)
file_format
=
serializers
.
CharField
(
max_length
=
10
,
write_only
=
True
)
file_format
=
serializers
.
CharField
(
max_length
=
10
)
size
=
serializers
.
IntegerField
()
class
Meta
:
class
Meta
:
model
=
Image
model
=
Image
...
@@ -18,5 +24,7 @@ class ImageSerializer(serializers.ModelSerializer):
...
@@ -18,5 +24,7 @@ class ImageSerializer(serializers.ModelSerializer):
"created_at"
,
"created_at"
,
"uploaded_by_user"
,
"uploaded_by_user"
,
"created_by"
,
"created_by"
,
"id"
,
"size"
,
)
)
read_only_fields
=
(
"created_at"
,
"uploaded_by_user"
,
"created_by"
,
"remote_id"
,
)
read_only_fields
=
(
"created_at"
,
"uploaded_by_user"
,
"created_by"
,
"remote_id"
,
"size"
,
)
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