I want to override the tree_id field as following:
Given:
class Thing(MPTTModel):
thing_id = models.AutoField(primary_key=True)
...
class MPTTMeta:
tree_id = ?
While creating the "Thing" first parent I want to initiate tree_id with the thing_id assigned when object is firstly saved.
Next, for "Thing" objects created later I want to pass the thing_id of the first parent created earlier.
i.e. all the nodes at tree will have as tree_id the objectId(thing_id) of the first ancestor.
Is it possible?
How have I to pass the value while creating the "Thing" objects?
Edit:
So it seems the solution for my needs is merely: Thing.objects.get(pk=thing_id).get_descendants()