I\'m using django rest framework and just creating a simple serializer like this:
class PackageSerializer(serializers.HyperlinkedModelSerializer):
class
I just tweaked this to make it a little more pluggable by creating this class:
class HyperlinkedModelSerializerWithId(serializers.HyperlinkedModelSerializer):
"""Extend the HyperlinkedModelSerializer to add IDs as well for the best of
both worlds.
"""
id = serializers.ReadOnlyField()
Then, just use that to make your serializer and you're on your way.