first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import Plant
|
||||
|
||||
|
||||
class PlantSerializer(serializers.ModelSerializer):
|
||||
"""سریالایزر خروجی / ورودی برای Plant."""
|
||||
|
||||
class Meta:
|
||||
model = Plant
|
||||
fields = [
|
||||
"id",
|
||||
"name",
|
||||
"light",
|
||||
"watering",
|
||||
"soil",
|
||||
"temperature",
|
||||
"planting_season",
|
||||
"harvest_time",
|
||||
"spacing",
|
||||
"fertilizer",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
]
|
||||
read_only_fields = ["id", "created_at", "updated_at"]
|
||||
Reference in New Issue
Block a user