26 lines
697 B
Python
26 lines
697 B
Python
|
|
from rest_framework import serializers
|
||
|
|
|
||
|
|
from .models import IrrigationMethod
|
||
|
|
|
||
|
|
|
||
|
|
class IrrigationMethodSerializer(serializers.ModelSerializer):
|
||
|
|
"""سریالایزر خروجی / ورودی برای IrrigationMethod."""
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
model = IrrigationMethod
|
||
|
|
fields = [
|
||
|
|
"id",
|
||
|
|
"name",
|
||
|
|
"category",
|
||
|
|
"description",
|
||
|
|
"water_efficiency_percent",
|
||
|
|
"water_pressure_required",
|
||
|
|
"flow_rate",
|
||
|
|
"coverage_area",
|
||
|
|
"soil_type",
|
||
|
|
"climate_suitability",
|
||
|
|
"created_at",
|
||
|
|
"updated_at",
|
||
|
|
]
|
||
|
|
read_only_fields = ["id", "created_at", "updated_at"]
|