Commit 98b16f41 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #140 in RMS/api-main-service from red-develop to RMSv2

* commit '331e95cd':
  added company and department name
parents 6fa7cf68 331e95cd
...@@ -3,6 +3,13 @@ from app.entities.models import AllowedCompany ...@@ -3,6 +3,13 @@ from app.entities.models import AllowedCompany
class AllowedCompanySerializer(serializers.ModelSerializer): class AllowedCompanySerializer(serializers.ModelSerializer):
def to_representation(self, instance):
ret = super().to_representation(instance)
ret['department_name'] = model_to_dict(instance.group_pivots)
ret['company_name'] = model_to_dict(instance.company_pivot)
return ret
class Meta: class Meta:
model = AllowedCompany model = AllowedCompany
fields = '__all__' fields = '__all__'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment