# Path: django_fordrop/api_v1.py
# class FileResource(ModelResource):
#     resource_name = 'file'
#     user = fields.ForeignKey(UserResource, 'user')
#     class Meta:
#         queryset = File.objects.all()
#         filtering = {
#             "uuid": ALL
#         }
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class FileCommentResource(ModelResource):
#     resource_name = 'filecomment'
#     file = fields.ForeignKey(FileResource, 'file', full=True)
#     class Meta:
#         queryset = FileComment.objects.all()
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class UserResource(ModelResource):
#     resource_name = 'user'
#     class Meta:
#         queryset = User.objects.all()
#         fields = ['username', 'is_active']
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class UserProfileResource(ModelResource):
#     user = fields.ForeignKey(UserResource, 'user', full=True)
#     class Meta:
#         queryset = UserProfile.objects.all()
#         excludes = ['id']
#         filtering = {
#             "uuid": ALL
#         }
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()


from django.conf.urls import patterns, include, url
from django.contrib import admin
from tastypie.api import Api
from django_fordrop.api_v1 import FileResource, FileCommentResource, UserResource, UserProfileResource
from django.views.generic.simple import direct_to_template

admin.autodiscover()

v1_api = Api(api_name='v1')
v1_api.register(FileResource())

# Path: django_fordrop/api_v1.py
# class FileResource(ModelResource):
#     resource_name = 'file'
#     user = fields.ForeignKey(UserResource, 'user')
#     class Meta:
#         queryset = File.objects.all()
#         filtering = {
#             "uuid": ALL
#         }
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class FileCommentResource(ModelResource):
#     resource_name = 'filecomment'
#     file = fields.ForeignKey(FileResource, 'file', full=True)
#     class Meta:
#         queryset = FileComment.objects.all()
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class UserResource(ModelResource):
#     resource_name = 'user'
#     class Meta:
#         queryset = User.objects.all()
#         fields = ['username', 'is_active']
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()
# 
# class UserProfileResource(ModelResource):
#     user = fields.ForeignKey(UserResource, 'user', full=True)
#     class Meta:
#         queryset = UserProfile.objects.all()
#         excludes = ['id']
#         filtering = {
#             "uuid": ALL
#         }
#         authorization = Authorization()
#         authentication = ApiKeyAuthentication()


# Path: fordropweb/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
from tastypie.api import Api
from django_fordrop.api_v1 import FileResource, FileCommentResource, UserResource, UserProfileResource
from django.views.generic.simple import direct_to_template


admin.autodiscover()

v1_api = Api(api_name='v1')
v1_api.register(FileResource())

v1_api.register(FileCommentResource())