0

I am trying to create a user tree using django-mptt. I have auth_user table and a one-to-one mapping table UserProperties which has a foreign key of auth_user. I added TreeForeignKey of django-mptt in UserProperties model(parent column) on User table. But it is failing while creating objects with following error:

'User' object has no attribute 'is_root_node'
Anuj
  • 1,160
  • 2
  • 20
  • 40
  • Are you using recent django which allow custom user models? This would allow you to combine User and UserProperties and might solve your problem. – PhoebeB Mar 05 '14 at 10:21
  • I am using django-1.4.10 which supports custom user models. – Anuj Mar 05 '14 at 10:53
  • I was thinking of the one introduced in 1.5 see https://docs.djangoproject.com/en/dev/releases/1.5/#configurable-user-model – PhoebeB Mar 05 '14 at 13:52

1 Answers1

2

The method (not attribute) 'is_root_node()' is valid on query-items

item = Class.objects.get()

or in iterator or list expression:

[item.is_root_node() for item in Class.objects.filter(name = 'name')]

But to address your question properly, could you give us the code for your model and your query, please.

thoma5
  • 21
  • 2