django-orchestra-test/orchestra/apps/contacts/serializers.py

17 lines
561 B
Python
Raw Normal View History

2014-05-08 16:59:35 +00:00
from rest_framework import serializers
from orchestra.api.serializers import MultiSelectField
from orchestra.apps.accounts.serializers import AccountSerializerMixin
2014-10-17 10:04:47 +00:00
from .models import Contact
2014-05-08 16:59:35 +00:00
class ContactSerializer(AccountSerializerMixin, serializers.HyperlinkedModelSerializer):
2014-09-04 15:55:43 +00:00
email_usage = MultiSelectField(choices=Contact.EMAIL_USAGES)
2014-05-08 16:59:35 +00:00
class Meta:
model = Contact
fields = (
'url', 'short_name', 'full_name', 'email', 'email_usage', 'phone',
'phone2', 'address', 'city', 'zipcode', 'country'
)