bb307d34d2
- Adds django rest framework to requirements - Adds basic plant model with id and name fields - Adds CRUD endpoints to interact with plant objects
9 lines
251 B
Python
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']
|