from app.entities import models
from rest_framework import serializers
from django.db.models import Q


class headers(serializers.ModelSerializer):


    def to_representation(self, instance):
        ret = super().to_representation(instance)
        ret['company'] = instance.company.name

        return ret



    class Meta:
        model = models.Department
        fields = (
            'code',
            'name'
        )
