Skip to content

Commit

Permalink
Make schema API pages work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericholscher committed Aug 21, 2012
1 parent b000022 commit 38ca662
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions readthedocs/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class Meta:

def override_urls(self):
return [
url(r"^(?P<resource_name>%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"),
url(r"^(?P<resource_name>%s)/(?P<username>[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"),
]

Expand Down Expand Up @@ -229,6 +230,7 @@ def post_list(self, request, **kwargs):

def override_urls(self):
return [
url(r"^(?P<resource_name>%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"),
url(r"^(?P<resource_name>%s)/search%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_search'), name="api_get_search"),
url(r"^(?P<resource_name>%s)/(?P<slug>[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"),
]
Expand All @@ -253,6 +255,7 @@ class Meta:

def override_urls(self):
return [
url(r"^(?P<resource_name>%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"),
url(r"^(?P<resource_name>%s)/(?P<project__slug>[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_list'), name="build_list_detail"),
]

Expand Down Expand Up @@ -313,6 +316,7 @@ def build_version(self, request, **kwargs):

def override_urls(self):
return [
url(r"^(?P<resource_name>%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"),
url(r"^(?P<resource_name>%s)/(?P<project_slug>[a-z-_]+)/highest/(?P<base>.+)/$" % self._meta.resource_name, self.wrap_view('version_compare'), name="version_compare"),
url(r"^(?P<resource_name>%s)/(?P<project_slug>[a-z-_]+)/highest/$" % self._meta.resource_name, self.wrap_view('version_compare'), name="version_compare"),
url(r"^(?P<resource_name>%s)/(?P<project__slug>[a-z-_]+[a-z0-9-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_list'), name="api_version_list"),
Expand All @@ -334,6 +338,7 @@ class Meta:

def override_urls(self):
return [
url(r"^(?P<resource_name>%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"),
url(r"^(?P<resource_name>%s)/search%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_search'), name="api_get_search"),
url(r"^(?P<resource_name>%s)/anchor%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_anchor'), name="api_get_anchor"),
]
Expand Down
12 changes: 12 additions & 0 deletions readthedocs/templates/admin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="{{ MEDIA_URL }}css/pecan/base.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}javascript/pecan/bundle.js"></script>
</head>
<body class="loading">

</body>
</html>
3 changes: 3 additions & 0 deletions readthedocs/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf.urls.defaults import url, patterns, include
from django.contrib import admin
from django.conf import settings
from django.views.generic.simple import direct_to_template

from tastypie.api import Api

Expand All @@ -23,6 +24,8 @@

urlpatterns = patterns('',
url(r'^$', 'core.views.homepage'),
url(r'^_admin/', direct_to_template, {'template': 'admin.html'}),

url(r'^docs/(?P<project_slug>[-\w]+)/(?P<lang_slug>en)/(?P<version_slug>[-._\w]+?)/(?P<filename>.*)$',
'core.views.serve_docs',
name='docs_detail'
Expand Down

0 comments on commit 38ca662

Please sign in to comment.