Oauth2 provider and initial api
This commit is contained in:
36
rowers/serializers.py
Normal file
36
rowers/serializers.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from rest_framework import serializers
|
||||
from rowers.models import Workout,Rower
|
||||
|
||||
# Serializers define the API representation.
|
||||
class RowerSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = Rower
|
||||
fields = (
|
||||
'weightcategory',
|
||||
)
|
||||
|
||||
|
||||
class WorkoutSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = Workout
|
||||
fields = (
|
||||
'id',
|
||||
'name',
|
||||
'date',
|
||||
'workouttype',
|
||||
'boattype',
|
||||
'starttime',
|
||||
'startdatetime',
|
||||
'distance',
|
||||
'duration',
|
||||
'weightcategory',
|
||||
'weightvalue',
|
||||
'averagehr',
|
||||
'maxhr',
|
||||
'notes',
|
||||
'summary',
|
||||
'csvfilename',
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user