Open GoogleCodeExporter opened 9 years ago
ALTER SEQUENCE blog_post_id_seq OWNED BY blog_post.id;
可解决。
参见:
http://stackoverflow.com/questions/6412962/django-admin-instance-needs-to-have-a
-primary-key-value-before-a-many-to-many
https://code.djangoproject.com/ticket/13295
https://code.djangoproject.com/ticket/13179
https://code.djangoproject.com/ticket/15682
http://stackoverflow.com/questions/6466836/postgres-sequences-without-an-owned-b
y-attribute-do-not-return-an-id-in-django
http://stackoverflow.com/questions/6090859/django-instance-needs-to-have-a-prima
ry-key-value-before-a-many-to-many-relatio
Original comment by liuqing....@gmail.com
on 30 Nov 2011 at 7:47
pylogs=# ALTER SEQUENCE blog_category_id_seq OWNED BY blog_category.id
pylogs-# ALTER SEQUENCE blog_post_category_id_seq OWNED BY blog_post_category.id
这两条也要加,要不然分类不正常
Original comment by liuqing....@gmail.com
on 9 Mar 2012 at 2:54
Original issue reported on code.google.com by
liuqing....@gmail.com
on 8 Nov 2011 at 10:46