# Path: search/web/views/api.py
# def index(request):
# def search(request):
#     def _build_course_doc(course):
#     def encode_obj(in_obj):
#         def encode_list(in_list):
#         def encode_dict(in_dict):
#     def _update_metadata(material):
#     def _merlot_search(params):
# def course_stats(request):
#     def get_queryset(self):
#     def list(self, request):
#     def get_queryset(self):
#     def list(self, request, *args, **kwargs):
#     def get_queryset(self):
#     def list(self, request, *args, **kwargs):
#     def get_queryset(self):
#     def serialize_tree(self, queryset, language=None, depth=0, max_depth=-1):
#     def list(self, request, **kwargs):
#         SOLR_URL = settings.SOLR_URL % 'default'
# class CourseDetail(generics.RetrieveAPIView):
# class CourseLatestList(generics.ListAPIView):
# class ProviderDetail(generics.RetrieveAPIView):
# class ProviderCourseList(generics.ListAPIView):
# class ProviderList(generics.ListAPIView):
# class LanguageList(viewsets.ViewSet):
# class CourseList(generics.ListAPIView):
# class CourseCategoryList(generics.ListAPIView):
# class CategoryList(generics.ListAPIView):


from django.conf.urls import patterns, url
from .views import api

urlpatterns = patterns('',
	url(r'^providers/(?P<provider>\d+)/courses/$', api.ProviderCourseList.as_view(), name='provider-courses-list'),
	url(r'^providers/(?P<pk>\d+)/$', api.ProviderDetail.as_view(), name='provider-detail'),
	url(r'^providers/$', api.ProviderList.as_view(), name='providers-list'),

	url(r'^courses/stats/$', 'web.views.api.course_stats', name='course-stats'),
	url(r'^courses/latest/$', api.CourseLatestList.as_view(), name='course-latest'),
	url(r'^courses/view/(?P<linkhash>\w+)/$', api.CourseDetail.as_view(lookup_field='linkhash'), name='course-detail'),
	url(r'^courses/search/$', 'web.views.api.search', name='search-query'),

	url(r'^languages/(?P<language>[\w|\W]+)/courses/$', api.CourseList.as_view(lookup_field='merlot_languages'), name='language-courses-list'),
	url(r'^languages/$', api.LanguageList.as_view({'get': 'list'}), name='language-list'),

	# url(r'^categories/(?P<category>[\w|\W]+)/(?P<language>[\w|\W]+)/$', views.CourseCategoryList.as_view(), name='category-course-list'),

# Path: search/web/views/api.py
# def index(request):
# def search(request):
#     def _build_course_doc(course):
#     def encode_obj(in_obj):
#         def encode_list(in_list):
#         def encode_dict(in_dict):
#     def _update_metadata(material):
#     def _merlot_search(params):
# def course_stats(request):
#     def get_queryset(self):
#     def list(self, request):
#     def get_queryset(self):
#     def list(self, request, *args, **kwargs):
#     def get_queryset(self):
#     def list(self, request, *args, **kwargs):
#     def get_queryset(self):
#     def serialize_tree(self, queryset, language=None, depth=0, max_depth=-1):
#     def list(self, request, **kwargs):
#         SOLR_URL = settings.SOLR_URL % 'default'
# class CourseDetail(generics.RetrieveAPIView):
# class CourseLatestList(generics.ListAPIView):
# class ProviderDetail(generics.RetrieveAPIView):
# class ProviderCourseList(generics.ListAPIView):
# class ProviderList(generics.ListAPIView):
# class LanguageList(viewsets.ViewSet):
# class CourseList(generics.ListAPIView):
# class CourseCategoryList(generics.ListAPIView):
# class CategoryList(generics.ListAPIView):


# Path: search/web/urls_api.py
from django.conf.urls import patterns, url
from .views import api


urlpatterns = patterns('',
	url(r'^providers/(?P<provider>\d+)/courses/$', api.ProviderCourseList.as_view(), name='provider-courses-list'),
	url(r'^providers/(?P<pk>\d+)/$', api.ProviderDetail.as_view(), name='provider-detail'),
	url(r'^providers/$', api.ProviderList.as_view(), name='providers-list'),

	url(r'^courses/stats/$', 'web.views.api.course_stats', name='course-stats'),
	url(r'^courses/latest/$', api.CourseLatestList.as_view(), name='course-latest'),
	url(r'^courses/view/(?P<linkhash>\w+)/$', api.CourseDetail.as_view(lookup_field='linkhash'), name='course-detail'),
	url(r'^courses/search/$', 'web.views.api.search', name='search-query'),

	url(r'^languages/(?P<language>[\w|\W]+)/courses/$', api.CourseList.as_view(lookup_field='merlot_languages'), name='language-courses-list'),
	url(r'^languages/$', api.LanguageList.as_view({'get': 'list'}), name='language-list'),

	# url(r'^categories/(?P<category>[\w|\W]+)/(?P<language>[\w|\W]+)/$', views.CourseCategoryList.as_view(), name='category-course-list'),

	url(r'^categories/(?P<category>[\w|\W]+)/$', api.CourseCategoryList.as_view(), name='category-course-list'),