You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.6 KiB
50 lines
1.6 KiB
from rest_framework import serializers
|
|
from .models import Product, Employee, Position, StorageLocation, Contractor, SupplyContract, Truck
|
|
|
|
class ProductSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Product
|
|
fields = '__all__'
|
|
ref_name = 'InventoryProductSerializer' # Unique ref_name for inventory
|
|
|
|
class PositionSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Position
|
|
fields = '__all__'
|
|
ref_name = 'InventoryPositionSerializer' # Unique ref_name for inventory
|
|
|
|
|
|
class EmployeeSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Employee
|
|
fields = '__all__'
|
|
ref_name = 'InventoryEmployeeSerializer' # Unique ref_name for inventory
|
|
|
|
|
|
class StorageLocationSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = StorageLocation
|
|
fields = '__all__'
|
|
ref_name = 'InventoryStorageLocationSerializer' # Unique ref_name for inventory
|
|
|
|
|
|
class ContractorSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Contractor
|
|
fields = '__all__'
|
|
ref_name = 'InventoryContractorSerializer' # Unique ref_name for inventory
|
|
|
|
|
|
class SupplyContractSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = SupplyContract
|
|
fields = '__all__'
|
|
ref_name = 'InventorySupplyContractSerializer' # Unique ref_name for inventory
|
|
|
|
|
|
class TruckSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Truck
|
|
fields = '__all__'
|
|
ref_name = 'InventoryTruckSerializer' # Unique ref_name for inventory
|