serializers.py 633 B

12345678910111213141516171819
  1. from rest_framework import serializers
  2. from panorama.models import Panorama, ReferencePoint
  3. class PanoramaSerializer(serializers.HyperlinkedModelSerializer):
  4. # fixme : return absolute URL for tiles_url
  5. class Meta:
  6. model = Panorama
  7. fields = ("url", "name", "loop",
  8. "latitude", "longitude", "altitude",
  9. "tiles_url")
  10. class ReferencePointSerializer(serializers.HyperlinkedModelSerializer):
  11. # fixme : return absolute URL for tiles_url
  12. class Meta:
  13. model = ReferencePoint
  14. fields = ("url", "name",
  15. "latitude", "longitude", "altitude")