I have the model:
from treebeard.ns_tree import NS_Node
class Category(NS_Node):
name = models.CharField(max_length=30)
node_order_by = ['id']
def __str__(self):
return self.name
and i try create new root element:
>>>from index.models import Category
>>>get = lambda node_id: Category.objects.get(pk=node_id)
>>>last_root = Category.get_last_root_node()
>>>get(last_root.pk).add_sibling(pos='sorted-sibling', name='ROOT2')
the following error:
Exception Value:
Cannot use None as a query value
Exception Location: e:\work\newsklad\lib\site-packages\django\db\models\sql\query.py in prepare_lookup_value, line 995
how remove this bag?