summaryrefslogtreecommitdiffstats
path: root/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'urls.py')
-rw-r--r--urls.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/urls.py b/urls.py
index 70012dd..1e2f0de 100644
--- a/urls.py
+++ b/urls.py
@@ -1,9 +1,30 @@
from django.conf.urls.defaults import *
+from django.conf import settings
+from equations.models import Equation, Symbol, Variable
urlpatterns = patterns('',
- # Example:
- # (r'^equator/', include('equator.foo.urls')),
-
- # Uncomment this for admin:
-# (r'^admin/', include('django.contrib.admin.urls')),
+ (r'^go/', 'django.views.generic.simple.direct_to_template',
+ {'template': 'go.html'}),
+ (r'^admin/', include('django.contrib.admin.urls')),
+ (r'^static/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': settings.MEDIA_ROOT}),
+)
+urlpatterns += patterns('django.views.generic.list_detail',
+ (r'^equation/$', 'object_list', dict(queryset=Equation.objects.all(),
+ paginate_by=20, allow_empty=True)),
+ (r'^equation/(?P<object_id>\d+)/$', 'object_detail',
+ dict(queryset=Equation.objects.all() )),
+ (r'^symbol/$', 'object_list', dict(queryset=Symbol.objects.all(),
+ paginate_by=20, allow_empty=True)),
+ (r'^symbol/(?P<object_id>\d+)/$', 'object_detail',
+ dict(queryset=Symbol.objects.all() )),
+ (r'^variable/$', 'object_list', dict(queryset=Variable.objects.all(),
+ paginate_by=20, allow_empty=True)),
+ (r'^variable/(?P<object_id>\d+)/$', 'object_detail',
+ dict(queryset=Variable.objects.all() )),
+)
+urlpatterns += patterns('equator.equations.views',
+ (r'^json/equs_by_vars/(?P<whichvars>[\d\,]*)/?$', 'equs_by_vars'),
+ (r'^json/all_vars/$', 'all_vars'),
+ (r'^json/all_symbs/$', 'all_symbs'),
)