diff options
Diffstat (limited to 'procurement/serializers.py')
-rw-r--r-- | procurement/serializers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/procurement/serializers.py b/procurement/serializers.py index 0466402..b3e9280 100644 --- a/procurement/serializers.py +++ b/procurement/serializers.py @@ -13,6 +13,17 @@ class SupplierSerializer(serializers.ModelSerializer): model = Supplier exclude = ('created', 'updated') +class SupplierComponentSerializer(serializers.ModelSerializer): + text = serializers.CharField(source="__str__", read_only=True) + class Meta: + model = Component + exclude = ('created', 'updated') + +class SupplierComponentsSerializer(serializers.ModelSerializer): + components = SupplierComponentSerializer(many=True, read_only=True) + class Meta: + model = Supplier + exclude = ('created', 'updated') class ComponentSerializer(serializers.ModelSerializer): text = serializers.CharField(source='__str__', read_only=True) |