Merge branch 'nested_json' into 'master'
nest the json See merge request !12
This commit is contained in:
commit
9257fbc5ab
@ -8,7 +8,6 @@ class MachineReservationSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = MachineReservation
|
||||
fields = (
|
||||
'machine',
|
||||
'user',
|
||||
'notes',
|
||||
)
|
||||
@ -19,7 +18,6 @@ class MachineStatusSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = MachineStatus
|
||||
fields = (
|
||||
'machine',
|
||||
'git_branch',
|
||||
'git_version',
|
||||
'last_db_refresh',
|
||||
@ -29,6 +27,8 @@ class MachineStatusSerializer(serializers.ModelSerializer):
|
||||
|
||||
class MachineSerializer(serializers.ModelSerializer):
|
||||
is_reserved = serializers.SerializerMethodField()
|
||||
status = MachineStatusSerializer()
|
||||
reservation = MachineReservationSerializer()
|
||||
|
||||
def get_is_reserved(self, machine):
|
||||
return machine.is_reserved()
|
||||
|
Loading…
Reference in New Issue
Block a user