OpenSlides/openslides/users/serializers.py

41 lines
888 B
Python
Raw Normal View History

from openslides.utils import rest_api
2015-01-06 00:11:22 +01:00
from .models import User
class UserShortSerializer(rest_api.serializers.ModelSerializer):
2015-01-06 00:11:22 +01:00
"""
Serializer for users.models.User objects.
Serializes only name fields.
2015-01-06 00:11:22 +01:00
"""
class Meta:
model = User
fields = (
'username',
'title',
2015-01-06 00:11:22 +01:00
'first_name',
'last_name',
'structure_level')
class UserFullSerializer(rest_api.serializers.ModelSerializer):
"""
Serializer for users.models.User objects.
Serializes all relevant fields.
"""
class Meta:
model = User
fields = (
'is_present',
'username',
'title',
'first_name',
'last_name',
'structure_level',
'about_me',
'comment',
'default_password',
'is_active')