taiga-back/greenmine/taggit/api.py

21 lines
659 B
Python

# myapp/api.py
from tastypie.resources import ModelResource
from tastypie.authentication import SessionAuthentication
from tastypie.authorization import DjangoAuthorization
from greenmine.taggit.models import *
class TagResource(ModelResource):
class Meta:
queryset = Tag.objects.all()
resource_name = 'tag'
authentication = SessionAuthentication()
authorization = DjangoAuthorization()
class TaggedItemResource(ModelResource):
class Meta:
queryset = TaggedItem.objects.all()
resource_name = 'taggeditem'
authentication = SessionAuthentication()
authorization = DjangoAuthorization()