RT。尝试通过django的ORM创建主键,但是失败。在postgresql中创建一个表如下:
Column | Type | Modifiers
----------
+-----------------
+--------
public_name | character varying(30) | not null
ctime | date | not null
Indexes:
"news_publication_pkey" PRIMARY KEY, btree (ctime, public_name)
使用python manage.py inspectdb得到的却是:
class NewsPublication(models.Model):
public_name = models.CharField(max_length=30)
ctime = models.DateField()
class Meta:
db_table = u'news_publication'
是否意味django的orm无法创建复合字段的主键呢?