Commit 6d1a37e6 authored by Rafal's avatar Rafal

test

parent c0801a83
......@@ -4,6 +4,7 @@ from rest_framework import viewsets, permissions
import rest_framework
from rest_framework.decorators import detail_route
from rest_framework.response import Response
import sys
from app.API.models import API, APIType
from app.API.serializers import APISerializer, APITypeSerializer
from app.User.models import UserAPI
......@@ -40,7 +41,7 @@ class APIViewSet(viewsets.ModelViewSet):
return HttpResponse(api.execute(function), content_type="application/json")
def get_queryset(self):
print "TEST1"
print >>sys.stderr, 'Goodbye, cruel world!'
queryset = API.objects.all()
username = self.request.query_params.get('only_new', None)
if username is not None:
......@@ -48,13 +49,10 @@ class APIViewSet(viewsets.ModelViewSet):
user_api = [api.api for api in user_api]
queryset = [api for api in queryset if api not in user_api]
method = self.request.query_params.get('method', None)
print "TEST2"
if method:
print "TEST3"
r = self.request.GET.copy()
del(r['method'])
self.request.GET = r
print self.request.GET
return APIViewSet.test(self.request, self.kwargs['pk'], method)
return queryset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment