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.*)$', '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\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\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\d+)/$', 'object_detail', dict(queryset=Variable.objects.all() )), ) urlpatterns += patterns('equations.views', (r'^json/equs_by_vars/(?P[\d\,]*)/?$', 'equs_by_vars'), (r'^json/vars_by_symbs/(?P[\d\,]*)/?$', 'vars_by_symbs'), (r'^json/all_variables/$', 'all_variables'), (r'^json/all_symbols/$', 'all_symbols'), )