최지우

redress error

from django.contrib import admin
from .models import Video, Phone
from .models import Video, Device, History, Lock
# Register your models here.
admin.site.register(Video)
admin.site.register(Phone)
\ No newline at end of file
admin.site.register(Device)
admin.site.register(History)
admin.site.register(Lock)
\ No newline at end of file
......
......@@ -17,5 +17,5 @@ class Lock(models.Model) :
state = models.BooleanField(default = True)
class History(models.Model) :
device = ForeignKey(Device, on_delete=models.CASCADE)
ctrtime = created = models.DateTimeField(default = timezone.now)
\ No newline at end of file
device = models.ForeignKey(Device, on_delete = models.CASCADE)
ctrtime =models.DateTimeField(default = timezone.now)
\ No newline at end of file
......
......@@ -4,8 +4,8 @@ from django.core import serializers
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.shortcuts import render
from api.models import Video, Phone
from api.serializers import VideoSerializer, PhoneSerializer
from api.models import Video, Device, History, Lock
from api.serializers import VideoSerializer, DeviceSerializer, HistorySerializer
from rest_framework import status
from rest_framework.views import APIView
......
......@@ -20,6 +20,6 @@ from api import views
urlpatterns = [
path('admin/', admin.site.urls),
path('api/video/<str:vidname>/', views.Video.as_view()),
path('api/checkDate/', views.CheckDate.as_view()),
path('video/<str:vidname>/', views.Video.as_view()),
path('checkDate/', views.CheckDate.as_view()),
]
......