Add initial implementations for forms and organization apps with serializers, factories, and admin configurations
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 5m5s
CI/CD Pipeline / Run Tests (push) Failing after 5m5s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 5m5s
CI/CD Pipeline / Run Tests (push) Failing after 5m5s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
This commit is contained in:
41
src/apps/organization/serializers.py
Normal file
41
src/apps/organization/serializers.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Сериализаторы для организаций.
|
||||
|
||||
Содержит:
|
||||
- OrganizationSerializer - полный сериализатор
|
||||
- OrganizationListSerializer - краткий для списков
|
||||
"""
|
||||
|
||||
from apps.organization.models import Organization
|
||||
from rest_framework import serializers
|
||||
|
||||
|
||||
class OrganizationSerializer(serializers.ModelSerializer):
|
||||
"""Полный сериализатор организации."""
|
||||
|
||||
class Meta:
|
||||
model = Organization
|
||||
fields = [
|
||||
"id",
|
||||
"name",
|
||||
"inn",
|
||||
"ogrn",
|
||||
"kpp",
|
||||
"okpo",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
]
|
||||
read_only_fields = ["id", "created_at", "updated_at"]
|
||||
|
||||
|
||||
class OrganizationListSerializer(serializers.ModelSerializer):
|
||||
"""Краткий сериализатор для списков."""
|
||||
|
||||
class Meta:
|
||||
model = Organization
|
||||
fields = [
|
||||
"id",
|
||||
"name",
|
||||
"inn",
|
||||
"ogrn",
|
||||
]
|
||||
Reference in New Issue
Block a user