Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Django 的自动增量的字段名称从更改id为类似的名称tablename_id?
id
tablename_id
我想在模型定义本身中做到这一点。
自动增量键是自动创建的,似乎没有办法通过db_column属性设置它。
db_column
class ModelTest(models.Model): tablename_id = models.AutoField(primary_key=True)
我希望我有所帮助。