Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
e6dd0f45
Commit
e6dd0f45
authored
Jan 17, 2017
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added url field (link to listing) in lieu of id for listing
parent
44ea61f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
bookshare/api/serializers.py
bookshare/api/serializers.py
+7
-2
No files found.
bookshare/api/serializers.py
View file @
e6dd0f45
...
...
@@ -6,10 +6,15 @@ from rest_framework import serializers
from
trades.models
import
Listing
class
ListingSerializer
(
serializers
.
ModelSerializer
):
class
ListingSerializer
(
serializers
.
HyperlinkedModelSerializer
):
url
=
serializers
.
HyperlinkedIdentityField
(
view_name
=
'detail_listing'
,
lookup_field
=
'slug'
)
class
Meta
:
model
=
Listing
fields
=
(
'title'
,
'author'
,
'isbn'
,
'year'
,
'edition'
,
fields
=
(
'
url'
,
'
title'
,
'author'
,
'isbn'
,
'year'
,
'edition'
,
'condition'
,
'access_code'
,
'course_abbr'
,
'description'
,
'price'
,
'photo'
,
'exchanged'
,
'cancelled'
,
'exchanged'
)
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