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.
30 lines
1.0 KiB
30 lines
1.0 KiB
from rest_framework import serializers
|
|
from .models import Product, Employee, Contractor, ContractorContact
|
|
|
|
class ProductSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Product
|
|
fields = [
|
|
'id', 'name', 'manufacturer', 'manufacturer_country', 'manufacturer_code',
|
|
'dimensions', 'unit', 'shelf_life', 'barcode', 'additional_info'
|
|
]
|
|
|
|
class EmployeeSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Employee
|
|
fields = [
|
|
'id', 'full_name', 'passport_series', 'passport_number', 'birth_date',
|
|
'position', 'department', 'login', 'password', 'role', 'work_phone',
|
|
'personal_phone', 'email'
|
|
]
|
|
|
|
class ContractorSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Contractor
|
|
fields = ['id', 'name', 'contract_number', 'address']
|
|
|
|
class ContractorContactSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = ContractorContact
|
|
fields = ['id', 'contractor', 'full_name', 'phone', 'email']
|