# Path: basic_cms/testproj/documents/views.py
# def document_view(request, *args, **kwargs):
#     context = kwargs
#     if kwargs.get('current_page', False):
#         documents = Document.objects.filter(page=kwargs['current_page'])
#         context['documents'] = documents
#     if 'document_id' in kwargs:
#         document = Document.objects.get(pk=int(kwargs['document_id']))
#         context['document'] = document
#     context['in_document_view'] = True
#     rcontext = RequestContext(request, context)
# 
#     return render_to_response('pages/examples/index.html', rcontext)
# 
# Path: basic_cms/http.py
# def pages_view(view):
#     """
#     Make sure the decorated view gets the essential pages
#     variables.
#     """
#     def pages_view_decorator(request, *args, **kwargs):
#         # if the current page is already there
#         if(kwargs.get('current_page', False) or
#                 kwargs.get('pages_navigation', False)):
#             return view(request, *args, **kwargs)
# 
#         path = kwargs.pop('path', None)
#         lang = kwargs.pop('lang', None)
#         if path:
#             from basic_cms.views import details
#             response = details(request, path=path, lang=lang,
#                 only_context=True, delegation=False)
#             context = response
#             extra_context_var = kwargs.pop('extra_context_var', None)
#             if extra_context_var:
#                 kwargs.update({extra_context_var: context})
#             else:
#                 kwargs.update(context)
#         return view(request, *args, **kwargs)
#     return pages_view_decorator


from django.conf.urls import *
from basic_cms.testproj.documents.views import document_view
from basic_cms.http import pages_view

urlpatterns = patterns('',
    url(r'^doc-(?P<document_id>[0-9]+)$', pages_view(document_view), name='document_details'),
    url(r'^$', pages_view(document_view), name='document_root'),

# Path: basic_cms/testproj/documents/views.py
# def document_view(request, *args, **kwargs):
#     context = kwargs
#     if kwargs.get('current_page', False):
#         documents = Document.objects.filter(page=kwargs['current_page'])
#         context['documents'] = documents
#     if 'document_id' in kwargs:
#         document = Document.objects.get(pk=int(kwargs['document_id']))
#         context['document'] = document
#     context['in_document_view'] = True
#     rcontext = RequestContext(request, context)
# 
#     return render_to_response('pages/examples/index.html', rcontext)
# 
# Path: basic_cms/http.py
# def pages_view(view):
#     """
#     Make sure the decorated view gets the essential pages
#     variables.
#     """
#     def pages_view_decorator(request, *args, **kwargs):
#         # if the current page is already there
#         if(kwargs.get('current_page', False) or
#                 kwargs.get('pages_navigation', False)):
#             return view(request, *args, **kwargs)
# 
#         path = kwargs.pop('path', None)
#         lang = kwargs.pop('lang', None)
#         if path:
#             from basic_cms.views import details
#             response = details(request, path=path, lang=lang,
#                 only_context=True, delegation=False)
#             context = response
#             extra_context_var = kwargs.pop('extra_context_var', None)
#             if extra_context_var:
#                 kwargs.update({extra_context_var: context})
#             else:
#                 kwargs.update(context)
#         return view(request, *args, **kwargs)
#     return pages_view_decorator


# Path: basic_cms/testproj/documents/urls.py
from django.conf.urls import *
from basic_cms.testproj.documents.views import document_view
from basic_cms.http import pages_view


urlpatterns = patterns('',
    url(r'^doc-(?P<document_id>[0-9]+)$', pages_view(document_view), name='document_details'),
    url(r'^$', pages_view(document_view), name='document_root'),

)