from rest_framework import serializers
from companies.models import Company

from drf_extra_fields.geo_fields import PointField
from tagulous.serializers.json import Serializer as TagSerializer
from utils.tag_serializers import TagListSerializerField, TaggitSerializer

class CompanySerializer(TaggitSerializer, serializers.ModelSerializer):

    tags = TagListSerializerField(required=False)
    geo = PointField(required=False, allow_null=True)

    class Meta:
        model = Company
        exclude = ['created', 'updated', 'creator']
