Created
October 13, 2014 20:00
-
-
Save stephenmcd/f0673790525f1c40d2ca to your computer and use it in GitHub Desktop.
Generate a Page Tree in Mezzanine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mezzanine.pages.models import RichTextPage | |
def generate_page_tree(per_branch): | |
for a in range(per_branch): | |
x = RichTextPage.objects.create(title="Page %s" % a) | |
for b in range(per_branch): | |
y = RichTextPage.objects.create(title="Page %s-%s" % (a, b), parent=x) | |
for c in range(per_branch): | |
z = RichTextPage.objects.create(title="Page %s-%s-%s" % (a, b, c), parent=y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment