Commits

Gustavo Picon committed 07a8db2

Added a main page for tbexample to choose a tree model for the forum

  • Participants
  • Parent commits dc6379f

Comments (0)

Files changed (3)

File tbexample/templates/tbexample/choose.html

+<html>
+  <head>
+    <title>Threaded forum example, built with django-treebeard</title>
+  </head>
+
+  <body>
+    
+    <h1>
+    Forum example,
+    built with <a href="http://code.google.com/p/django-treebeard/">django-treebeard</a>
+    </h1>
+
+    Choose a tree model:
+
+    <ul>
+      <li><a href="{% url main-view "al" %}">Adjacency List Tree (AL)</a></li>
+      <li><a href="{% url main-view "mp" %}">Materialized Path Tree (MP)</a></li>
+      <li><a href="{% url main-view "ns" %}">Nested Sets Tree (NS)</a></li>
+    </ul>
+  </body>
+</html>

File tbexample/urls.py

 
 from django.conf.urls.defaults import *
 from tbexample.views import convo, load_random_data, delete_node, delete_all
+from tbexample.views import choose
 
 baseurl = r'^(?P<treetype>mp|al|ns)/'
 lurls = [
 urlpatterns = []
 for pat, view, name in lurls:
     urlpatterns += patterns('', url('%s%s' % (baseurl, pat), view, name=name))
+urlpatterns += patterns('', url('', choose, name='choose-tree'))

File tbexample/views.py

     return render_to_response(template_html, data)
 
 
+def choose(request):
+    return render_to_response('tbexample/choose.html', {})