list of rancher plans api by rancher id - complete
This commit is contained in:
@@ -179,3 +179,13 @@ class IncentivePlanRancherSerializer(serializers.ModelSerializer):
|
||||
raise exceptions.RancherIncentivePlanExists()
|
||||
|
||||
return attrs
|
||||
|
||||
def to_representation(self, instance: product_models.IncentivePlanRancher):
|
||||
representations = super().to_representation(instance)
|
||||
|
||||
representations['plan_name'] = instance.plan.name
|
||||
representations['rancher_id'] = instance.rancher.id
|
||||
representations['livestock_type_name'] = instance.livestock_type.name
|
||||
representations['allowed_quantity'] = instance.allowed_quantity
|
||||
|
||||
return representations
|
||||
|
||||
Reference in New Issue
Block a user