from rest_framework import serializers
from .models import *

from django.db import models
from django.contrib.auth.models import User
from rest_framework.permissions import BasePermission

############
## Events ##
############


class CompanySerializer(serializers.ModelSerializer):
    class Meta:
        model = Company
        # fields = ('id', 'name', 'website', 'city', 'latitude', 'longitude', 'has_map')
        fields = '__all__'


class ContractSerializer(serializers.ModelSerializer):
    company = CompanySerializer(many=False)
    # target_language = serializers.SerializerMethodField()
    class Meta:
        model = Contract
        fields = '__all__'
        depth = 2
#        fields = ('id', 'name',)