diff options
Diffstat (limited to 'pharos-dashboard/src/api/serializers.py')
-rw-r--r-- | pharos-dashboard/src/api/serializers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pharos-dashboard/src/api/serializers.py b/pharos-dashboard/src/api/serializers.py index f8f02a2..237ca02 100644 --- a/pharos-dashboard/src/api/serializers.py +++ b/pharos-dashboard/src/api/serializers.py @@ -13,10 +13,9 @@ from rest_framework import serializers from booking.models import Booking from dashboard.models import Server, Resource, ResourceStatus - class BookingSerializer(serializers.ModelSerializer): - installer_name = serializers.RelatedField(source='installer', read_only=True) - scenario_name = serializers.RelatedField(source='scenario', read_only=True) + installer_name = serializers.CharField(source='installer.name') + scenario_name = serializers.CharField(source='scenario.name') class Meta: model = Booking @@ -37,4 +36,4 @@ class ResourceSerializer(serializers.ModelSerializer): class ResourceStatusSerializer(serializers.ModelSerializer): class Meta: model = ResourceStatus - fields = ('id', 'resource', 'timestamp','type', 'title', 'content')
\ No newline at end of file + fields = ('id', 'resource', 'timestamp','type', 'title', 'content') |