コード例 #1
0
ファイル: tests.py プロジェクト: georgedorn/readthedocs.org
 def test_simple_docview_from_url(self):
     url = self.project.get_absolute_url()
     dv = DocView.from_url(url)
     self.assertEqual(dv.project, self.project)
     self.assertEqual(dv.version, self.version)
     self.assertEqual(dv.language, 'en')
     self.assertEqual(dv.sphinx_filename, 'index.html')
コード例 #2
0
ファイル: views.py プロジェクト: georgedorn/readthedocs.org
def log_page_view(request):
    """
    Intended to be used asynchronously, with an ajax callback
    with page details.  
    """
    url = request.GET.get('url')
    dispatched = resolve(url)
    
    if dispatched.url_name.startswith('docs') \
        or dispatched.view_name.startswith('docs'):
        
        dv = DocView.from_url(url)
        dv.user = request.user