serializers.py 375 Bytes
Newer Older
1 2 3 4 5
"""
go/serializers.py

Define how data is translated from the database to json/API representation.
"""
David Haynes's avatar
David Haynes committed
6 7 8 9
# App Imports
from .models import URL, RegisteredUser

# Third Party Imports
10 11
from rest_framework import serializers

David Haynes's avatar
David Haynes committed
12
class URLSerializer(serializers.HyperlinkedModelSerializer):
13
    class Meta:
David Haynes's avatar
David Haynes committed
14
        model = URL
David Haynes's avatar
David Haynes committed
15
        fields = ('destination', 'short', 'date_expires')