-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoints wired into the frontend, needs the frontend improving to dr…
…aw / redraw based on the users selection
- Loading branch information
Showing
5 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
from rest_framework import serializers | ||
|
||
from .models import DeviceModuleReading | ||
from .models import DeviceModule, DeviceModuleReading | ||
|
||
|
||
class DeviceModuleReadingSerializer(serializers.HyperlinkedModelSerializer): | ||
class DeviceModuleSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = DeviceModule | ||
fields = "__all__" | ||
|
||
|
||
class DeviceModuleReadingSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = DeviceModuleReading | ||
fields = "__all__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
from django.template.response import TemplateResponse | ||
from rest_framework import viewsets | ||
|
||
from .models import DeviceModuleReading | ||
from .serlializers import DeviceModuleReadingSerializer | ||
from .models import DeviceModule, DeviceModuleReading | ||
from .serlializers import DeviceModuleReadingSerializer, DeviceModuleSerializer | ||
|
||
|
||
def index(request): | ||
response = TemplateResponse(request, "shedpi_hub_dashboard/index.html", {}) | ||
return response | ||
|
||
|
||
class DeviceModuleViewSet(viewsets.ModelViewSet): | ||
queryset = DeviceModule.objects.all() | ||
serializer_class = DeviceModuleSerializer | ||
|
||
|
||
class DeviceModuleReadingViewSet(viewsets.ModelViewSet): | ||
queryset = DeviceModuleReading.objects.all() | ||
serializer_class = DeviceModuleReadingSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters