# Path: libre/apps/data_drivers/views.py
# class LibreMetadataList(generics.GenericAPIView):
#     def get(self, request, *args, **kwargs):
#         return Response(dict([(i, getattr(main, i)) for i in ['__author__', '__copyright__', '__credits__', '__email__', '__license__', '__maintainer__', '__status__', '__version__', '__version_info__']]))
# 
# class SourceDataVersionList(CustomListAPIView):
#     serializer_class = SourceDataVersionSerializer
# 
#     def get_queryset(self):
#         return SourceDataVersion.objects.filter(ready=True)
# 
# class SourceDataVersionDetail(CustomRetrieveAPIView):
#     serializer_class = SourceDataVersionSerializer
# 
#     def get_queryset(self):
#         return SourceDataVersion.objects.filter(ready=True)
# 
# class SourceDetail(CustomRetrieveAPIView):
#     serializer_class = SourceSerializer
# 
#     def get_queryset(self):
#         return Source.allowed.for_user(self.request.user)
# 
# class SourceList(CustomListAPIView):
#     serializer_class = SourceSerializer
# 
#     def get_queryset(self):
#         return Source.allowed.for_user(self.request.user)
# 
# class SourceGetAll(LIBREView):
#     def get(self, request, *args, **kwargs):
#         initial_datetime = datetime.datetime.now()
# 
#         source = self.get_object()
#         self.get_renderer_extra_variables(request)
#         result = source.get_all(parameters=parse_request(request))
#         logger.debug('Total view elapsed time: %s' % (datetime.datetime.now() - initial_datetime))
# 
#         return CustomResponse(result)
# 
# class SourceGetOne(LIBREView):
#     def get(self, request, *args, **kwargs):
#         initial_datetime = datetime.datetime.now()
# 
#         source = self.get_object()
#         self.get_renderer_extra_variables(request)
#         result = source.get_one(int(kwargs['id']), parameters=parse_request(request))
#         logger.debug('Total view elapsed time: %s' % (datetime.datetime.now() - initial_datetime))
# 
#         return CustomResponse(result)


from django.conf.urls.defaults import patterns, url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import (
    LibreMetadataList, SourceDataVersionList, SourceDataVersionDetail,
    SourceDetail, SourceList, SourceGetAll, SourceGetOne)



urlpatterns = patterns(
    'data_drivers.views',
    url(r'^$', 'api_root', name='api_root'),

    url(r'^libre/$', LibreMetadataList.as_view(), name='libremetadata-list'),

    url(r'^sources/$', SourceList.as_view(), name='source-list'),
    url(r'^sources/(?P<slug>[-\w]+)/$', SourceDetail.as_view(), name='source-detail'),

# Path: libre/apps/data_drivers/views.py
# class LibreMetadataList(generics.GenericAPIView):
#     def get(self, request, *args, **kwargs):
#         return Response(dict([(i, getattr(main, i)) for i in ['__author__', '__copyright__', '__credits__', '__email__', '__license__', '__maintainer__', '__status__', '__version__', '__version_info__']]))
# 
# class SourceDataVersionList(CustomListAPIView):
#     serializer_class = SourceDataVersionSerializer
# 
#     def get_queryset(self):
#         return SourceDataVersion.objects.filter(ready=True)
# 
# class SourceDataVersionDetail(CustomRetrieveAPIView):
#     serializer_class = SourceDataVersionSerializer
# 
#     def get_queryset(self):
#         return SourceDataVersion.objects.filter(ready=True)
# 
# class SourceDetail(CustomRetrieveAPIView):
#     serializer_class = SourceSerializer
# 
#     def get_queryset(self):
#         return Source.allowed.for_user(self.request.user)
# 
# class SourceList(CustomListAPIView):
#     serializer_class = SourceSerializer
# 
#     def get_queryset(self):
#         return Source.allowed.for_user(self.request.user)
# 
# class SourceGetAll(LIBREView):
#     def get(self, request, *args, **kwargs):
#         initial_datetime = datetime.datetime.now()
# 
#         source = self.get_object()
#         self.get_renderer_extra_variables(request)
#         result = source.get_all(parameters=parse_request(request))
#         logger.debug('Total view elapsed time: %s' % (datetime.datetime.now() - initial_datetime))
# 
#         return CustomResponse(result)
# 
# class SourceGetOne(LIBREView):
#     def get(self, request, *args, **kwargs):
#         initial_datetime = datetime.datetime.now()
# 
#         source = self.get_object()
#         self.get_renderer_extra_variables(request)
#         result = source.get_one(int(kwargs['id']), parameters=parse_request(request))
#         logger.debug('Total view elapsed time: %s' % (datetime.datetime.now() - initial_datetime))
# 
#         return CustomResponse(result)


# Path: libre/apps/data_drivers/urls.py
from django.conf.urls.defaults import patterns, url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import (
    LibreMetadataList, SourceDataVersionList, SourceDataVersionDetail,
    SourceDetail, SourceList, SourceGetAll, SourceGetOne)




urlpatterns = patterns(
    'data_drivers.views',
    url(r'^$', 'api_root', name='api_root'),

    url(r'^libre/$', LibreMetadataList.as_view(), name='libremetadata-list'),

    url(r'^sources/$', SourceList.as_view(), name='source-list'),
    url(r'^sources/(?P<slug>[-\w]+)/$', SourceDetail.as_view(), name='source-detail'),

    url(r'^sources/(?P<slug>[-\w]+)/data/$', SourceGetAll.as_view(), name='source-get_all'),