My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 12 attachment: mptt-issue-12-order_insertion_by-fix.diff (672 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/mptt/__init__.py b/mptt/__init__.py
index f2d49f2..f0b007b 100644
--- a/mptt/__init__.py
+++ b/mptt/__init__.py
@@ -37,7 +37,10 @@ def register(model, parent_attr='parent', left_attr='lft', right_attr='rght',
opts.tree_id_attr = tree_id_attr
opts.level_attr = level_attr
opts.tree_manager_attr = tree_manager_attr
- opts.order_insertion_by = order_insertion_by
+ if isinstance(order_insertion_by, str):
+ opts.order_insertion_by = [order_insertion_by]
+ else:
+ opts.order_insertion_by = order_insertion_by

# Add tree fields if they do not exist
for attr in [left_attr, right_attr, tree_id_attr, level_attr]:
Powered by Google Project Hosting