From 67ecc108bd9b6a86f5ae5af9d9424e929d2db064 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 20 Oct 2016 00:26:53 +0800 Subject: [PATCH] Command parser --- apps/audits/api.py | 9 ++++----- apps/audits/serializers.py | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/audits/api.py b/apps/audits/api.py index 4801c2e5e..8b20f16c2 100644 --- a/apps/audits/api.py +++ b/apps/audits/api.py @@ -5,8 +5,7 @@ from rest_framework import generics import serializers - -from .models import ProxyLog, CommandLog +import models from .hands import IsSuperUserOrTerminalUser, Terminal @@ -30,7 +29,7 @@ class ProxyLogListCreateApi(generics.ListCreateAPIView): } """ - queryset = ProxyLog.objects.all() + queryset = models.ProxyLog.objects.all() serializer_class = serializers.ProxyLogSerializer permission_classes = (IsSuperUserOrTerminalUser,) @@ -40,12 +39,12 @@ class ProxyLogListCreateApi(generics.ListCreateAPIView): class ProxyLogDetailApi(generics.RetrieveUpdateDestroyAPIView): - queryset = ProxyLog.objects.all() + queryset = models.ProxyLog.objects.all() serializer_class = serializers.ProxyLogSerializer permission_classes = (IsSuperUserOrTerminalUser,) class CommandLogCreateApi(generics.ListCreateAPIView): - queryset = CommandLog.objects.all() + queryset = models.CommandLog.objects.all() serializer_class = serializers.CommandLogSerializer permission_classes = (IsSuperUserOrTerminalUser,) diff --git a/apps/audits/serializers.py b/apps/audits/serializers.py index 97be972ae..1b2485657 100644 --- a/apps/audits/serializers.py +++ b/apps/audits/serializers.py @@ -14,6 +14,3 @@ class ProxyLogSerializer(serializers.ModelSerializer): class CommandLogSerializer(serializers.ModelSerializer): class Meta: model = models.CommandLog - - -