相关疑难解决方法(0)

没有'拥有'属性的Postgres序列不会在Django 1.3中返回id

在最近从Oracle迁移到Postgres并从Django 1.2升级到1.3之后,我们在将对象保存到数据库时遇到了问题.当调用save()时,不返回id,即使通过标准django管理面板保存标准django auth模型,也会发生这种情况(即使用户已添加到db,也会返回'/ admin/auth/user/None /')并有一个id).

我们运行相同数据库的所有其他站点都没有这个问题,但是它们运行的​​是Django 1.1或1.2.

我们发现,对于迁移后创建的新表,它们的序列具有"拥有"属性,该属性由序列所在的列(通常是id列)拥有.改变'拥有'属性修复了我们在1.3中遇到的问题.

有人知道这个问题的根源是什么吗?我们已经找到了解决方案,如果其他人有这个问题,但我们很想知道是什么导致了这个问题.

django postgresql

7
推荐指数
1
解决办法
1221
查看次数

Django的南方(迁移工具)是否适用于innodb?

$ py manage.py  migrate turkey
Running migrations for turkey:
 - Migrating forwards to 0001_initial.
 > turkey:0001_initial
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   = DROP TABLE `turkey_demorecs` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like …
Run Code Online (Sandbox Code Playgroud)

python django django-south

5
推荐指数
1
解决办法
3046
查看次数

标签 统计

django ×2

django-south ×1

postgresql ×1

python ×1