Commit e6dd0f45 authored by Daniel W Bond's avatar Daniel W Bond

added url field (link to listing) in lieu of id for listing

parent 44ea61f2
......@@ -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')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment