google-code-export / django-mptt

Automatically exported from code.google.com/p/django-mptt
Other
0 stars 0 forks source link

'Document' object has no attribute '?' #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Documentation states that one registers the models with:
> mptt.register(Document, order_insertion_by='title')

this fails for me with a `No Atrribute Error` see output

the fix was to register as follows:
> mptt.register(Document, order_insertion_by=['title']) 

This is because _insertion_target_filters(node, order_insertion_by): is
trying to loop over each element in order_insertion_by. So when a single
string is sent then the out come is each letter of the string.

...
for field in order_insertion_by:
        value = getattr(node, field)
...

Original issue reported on code.google.com by lim...@gmail.com on 9 Jan 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Same problem, same fix, you need to update the doc

Original comment by cou...@gmail.com on 12 Mar 2009 at 10:25

GoogleCodeExporter commented 9 years ago
This change is in SVN, with a corresponding change in the SVN documentation

Original comment by jonathan.buchanan on 3 Jul 2009 at 10:48