Commit fa515558 authored by lukas.burgey's avatar lukas.burgey

Add a serializer for UserPreferences

parent 3aa931af
......@@ -3,7 +3,7 @@ from rest_framework.serializers import ModelSerializer, Serializer, CharField, J
from rest_polymorphic.serializers import PolymorphicSerializer
from feudal.backend.models import Site, Service
from feudal.backend.models.users import User, SSHPublicKey
from feudal.backend.models.users import User, SSHPublicKey, UserPreferences
from feudal.backend.models.deployments import CredentialState, DeploymentState, Deployment, VODeployment, ServiceDeployment
from feudal.backend.models.auth.serializers import VOSerializer
......@@ -158,12 +158,22 @@ class DeploymentSerializer(PolymorphicSerializer):
}
class UserPreferencesSerializer(ModelSerializer):
class Meta:
model = UserPreferences
fields = (
'deployment_mode',
)
class UserStateSerializer(ModelSerializer):
deployments = DeploymentSerializer(many=True)
services = ServiceSerializer(many=True)
ssh_keys = SSHPublicKeySerializer(many=True)
states = DeploymentStateSerializer(many=True)
vos = VOSerializer(many=True)
preferences = UserPreferencesSerializer()
class Meta:
model = User
......@@ -176,6 +186,7 @@ class UserStateSerializer(ModelSerializer):
'states',
'userinfo',
'vos',
'preferences',
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment