Answer the question
In order to leave comments, you need to log in
Why is primary_key not editable in django?
Available model
class TreeNode(MPTTModel):
id = models.CharField(max_length=10, primary_key=True)
itn = models.CharField(max_length=40, unique=True)
Answer the question
In order to leave comments, you need to log in
The primary key is not meant to be edited at all, and no one expects you to edit it. Any side effects may appear. Why do you need it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question