|
|
@@ -1,13 +1,13 @@ |
|
|
|
from rest_framework.response import Response |
|
|
|
from rest_framework.views import APIView |
|
|
|
from rest_framework.authentication import TokenAuthentication |
|
|
|
from rest_framework.authentication import TokenAuthentication, SessionAuthentication |
|
|
|
from rest_framework.permissions import IsAuthenticated |
|
|
|
from .models import TaxType, Country, State, City, Client |
|
|
|
from .serializers import TaxTypeSerializer, CountrySerializer, StateSerializer, CitySerializer, ClientSerializer |
|
|
|
|
|
|
|
|
|
|
|
class TaxTypeList(APIView): |
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
authentication_classes = [TokenAuthentication, SessionAuthentication] |
|
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
|
|
def get(self, request): |
|
|
@@ -17,7 +17,7 @@ class TaxTypeList(APIView): |
|
|
|
|
|
|
|
|
|
|
|
class CountryList(APIView): |
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
authentication_classes = [TokenAuthentication, SessionAuthentication] |
|
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
|
|
def get(self, request): |
|
|
@@ -27,7 +27,7 @@ class CountryList(APIView): |
|
|
|
|
|
|
|
|
|
|
|
class StateList(APIView): |
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
authentication_classes = [TokenAuthentication, SessionAuthentication] |
|
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
|
|
def get(self, request): |
|
|
@@ -37,7 +37,7 @@ class StateList(APIView): |
|
|
|
|
|
|
|
|
|
|
|
class CityList(APIView): |
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
authentication_classes = [TokenAuthentication, SessionAuthentication] |
|
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
|
|
def get(self, request): |
|
|
@@ -47,7 +47,7 @@ class CityList(APIView): |
|
|
|
|
|
|
|
|
|
|
|
class ClientList(APIView): |
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
authentication_classes = [TokenAuthentication, SessionAuthentication] |
|
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
|
|
def get(self, request): |
|
|
|