summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/src/api/serializers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pharos-dashboard/src/api/serializers.py')
-rw-r--r--tools/pharos-dashboard/src/api/serializers.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/pharos-dashboard/src/api/serializers.py b/tools/pharos-dashboard/src/api/serializers.py
index f8f02a2c..237ca029 100644
--- a/tools/pharos-dashboard/src/api/serializers.py
+++ b/tools/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')