Showing
4 changed files
with
10 additions
and
8 deletions
1 | from django.contrib import admin | 1 | from django.contrib import admin |
2 | -from .models import Video, Phone | 2 | +from .models import Video, Device, History, Lock |
3 | # Register your models here. | 3 | # Register your models here. |
4 | admin.site.register(Video) | 4 | admin.site.register(Video) |
5 | -admin.site.register(Phone) | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
5 | +admin.site.register(Device) | ||
6 | +admin.site.register(History) | ||
7 | +admin.site.register(Lock) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -17,5 +17,5 @@ class Lock(models.Model) : | ... | @@ -17,5 +17,5 @@ class Lock(models.Model) : |
17 | state = models.BooleanField(default = True) | 17 | state = models.BooleanField(default = True) |
18 | 18 | ||
19 | class History(models.Model) : | 19 | class History(models.Model) : |
20 | - device = ForeignKey(Device, on_delete=models.CASCADE) | ||
21 | - ctrtime = created = models.DateTimeField(default = timezone.now) | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
20 | + device = models.ForeignKey(Device, on_delete = models.CASCADE) | ||
21 | + ctrtime =models.DateTimeField(default = timezone.now) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,8 +4,8 @@ from django.core import serializers | ... | @@ -4,8 +4,8 @@ from django.core import serializers |
4 | from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist | 4 | from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist |
5 | from django.shortcuts import render | 5 | from django.shortcuts import render |
6 | 6 | ||
7 | -from api.models import Video, Phone | 7 | +from api.models import Video, Device, History, Lock |
8 | -from api.serializers import VideoSerializer, PhoneSerializer | 8 | +from api.serializers import VideoSerializer, DeviceSerializer, HistorySerializer |
9 | 9 | ||
10 | from rest_framework import status | 10 | from rest_framework import status |
11 | from rest_framework.views import APIView | 11 | from rest_framework.views import APIView | ... | ... |
... | @@ -20,6 +20,6 @@ from api import views | ... | @@ -20,6 +20,6 @@ from api import views |
20 | 20 | ||
21 | urlpatterns = [ | 21 | urlpatterns = [ |
22 | path('admin/', admin.site.urls), | 22 | path('admin/', admin.site.urls), |
23 | - path('api/video/<str:vidname>/', views.Video.as_view()), | 23 | + path('video/<str:vidname>/', views.Video.as_view()), |
24 | - path('api/checkDate/', views.CheckDate.as_view()), | 24 | + path('checkDate/', views.CheckDate.as_view()), |
25 | ] | 25 | ] | ... | ... |
-
Please register or login to post a comment