right-tree/backend/right_tree/api/serializers.py
Dana Lambert bb307d34d2 Add django rest framework and basic plant model
- Adds django rest framework to requirements
- Adds basic plant model with id and name fields
- Adds CRUD endpoints to interact with plant objects
2021-10-07 08:59:57 +13:00

9 lines
251 B
Python

from rest_framework import serializers
from right_tree.api.models import Plant
class PlantSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.ReadOnlyField()
class Meta:
model = Plant
fields = ['id', 'name']