url.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Create your views here.
from django.shortcuts import render_to_response
from django import template
from history.menu.models import Page
from history.text.models import Static
register = template.Library()
@register.inclusion_tag('page/menu.html')
def get_tree(pid = 0):
if pid == 0:
list = Page.objects.all().filter(pid__isnull=True, issub=0).order_by('main')
else:
list = Page.objects.all().filter(pid=pid, issub=0).order_by('main')
return {'list': list}