summaryrefslogtreecommitdiffstats
path: root/urls.py
blob: 3a6829a35be6f3a8315b535fa84734650fda00c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from equations.models import Equation, Symbol, Variable

#admin.autodiscover()

urlpatterns = patterns('',
    (r'^$', 'django.views.generic.simple.direct_to_template',
        {'template': 'index.html'}),
    (r'^go/', 'django.views.generic.simple.direct_to_template',
        {'template': 'go.html'}),
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    #(r'^admin/(.*)', admin.site.root),
    (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('equations.views',
    (r'^json/equs_by_vars/(?P<whichvars>[\d\,]*)/?$', 'equs_by_vars'),
    (r'^json/vars_by_symbs/(?P<which_symbols>[\d\,]*)/?$', 'vars_by_symbs'),
    (r'^json/all_variables/$', 'all_variables'),
    (r'^json/all_symbols/$', 'all_symbols'),
)