Django post primary key as slug? How do I reference the primary key in models.py?

后端 未结 0 1275
梦毁少年i
梦毁少年i 2020-11-21 07:21

When creating the slug for my post model, I want to use the object\'s primary key as the slug. However when I create a new post, instance.id is NoneType and not

相关标签:
回答
  • 消灭零回复
提交回复
热议问题