+ if folder:
+ f = Folder.objects.get(parent__exact=folder, slug__exact=part)
+ else:
+ f = Folder.objects.get(parent__isnull=True, slug__exact=part)
+ folder = f
+ except:
+ break
+
+ # We have the folder (in theory)
+ menu_items = []
+ if folder:
+ items = Document.objects.filter(folder__exact=folder, \
+ islive__exact=True)
+ for item in items:
+ if item.slug != 'index':
+ menu_items.append(
+ {
+ 'title': item.title,
+ 'url': item.get_absolute_url(),
+ }
+ )
+ folders = Folder.objects.filter(parent__exact=folder)
+ for folder in folders: