Commit 30259ba0 authored by Daniel W Bond's avatar Daniel W Bond

essentially all listing information is made available on the listings page,...

essentially all listing information is made available on the listings page, minus bidding or user information
parent 34141391
......@@ -13,8 +13,22 @@ class ListingSerializer(serializers.HyperlinkedModelSerializer):
lookup_field = 'slug'
)
active = serializers.SerializerMethodField('active')
active = serializers.SerializerMethodField('final_price')
active = serializers.SerializerMethodField('old')
def active(self, listing):
return listing.active()
def final_price(self, listing):
return listing.final_price()
def old(self, listing):
return listing.old()
class Meta:
model = Listing
fields = ('url', 'title', 'author', 'isbn', 'year', 'edition',
'condition', 'access_code', 'course_abbr', 'description',
'price', 'photo', 'exchanged', 'cancelled', 'exchanged')
fields = ('url', 'title', 'author', 'isbn', 'year', 'edition', 'condition',
'access_code', 'course_abbr', 'description', 'price', 'photo',
'active', 'old',
'exchanged', 'cancelled', 'date_closed', 'final_price')
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