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

18 lines
591 B
Python
Raw Permalink Normal View History

2014-05-08 16:59:35 +00:00
from rest_framework import serializers
2015-04-23 14:34:04 +00:00
#from orchestra.api.serializers import MultiSelectField
2015-04-05 10:46:24 +00:00
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
2014-05-08 16:59:35 +00:00
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):
2015-04-23 14:34:04 +00:00
email_usage = serializers.MultipleChoiceField(choices=Contact.EMAIL_USAGES)
2014-05-08 16:59:35 +00:00
class Meta:
model = Contact
fields = (
2015-04-30 09:51:55 +00:00
'url', 'id', 'short_name', 'full_name', 'email', 'email_usage', 'phone',
2014-05-08 16:59:35 +00:00
'phone2', 'address', 'city', 'zipcode', 'country'
)