1 ##############################################################################
2 # Copyright (c) 2016 Max Breitenfeldt and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from rest_framework import serializers
13 from booking.models import Booking
14 from dashboard.models import Server, Resource
17 class BookingSerializer(serializers.HyperlinkedModelSerializer):
20 fields = ('id', 'resource', 'start', 'end', 'purpose')
23 class ServerSerializer(serializers.HyperlinkedModelSerializer):
26 fields = ('id', 'resource', 'name', 'model', 'cpu', 'ram', 'storage')
29 class ResourceSerializer(serializers.HyperlinkedModelSerializer):
32 fields = ('id', 'name', 'description', 'url', 'server_set')