Django 1.8 AttributeError(“'module' object has no attribute 'commit_unless_managed'”)

前端 未结 1 1352
予麋鹿
予麋鹿 2021-01-25 11:12

Seems like django 1.8 deprecated support for commit_unless_managed module. Any suggestions on what alternatives one should use ?

相关标签:
1条回答
  • 2021-01-25 11:49

    There isn't a drop in replacement. You should be switching to using the new apis like transaction.atomic that were introduced in Django 1.6.

    The changes you have to make depend on which version are you upgrading from. If you were running Django 1.6 or 1.7 before, then commit_unless_managed was a no-op, and wasn't doing anything. If you're updating from an even earlier version, then you need to consider the effect of the change to database-level autocommit in auto mode in Django 1.6.

    0 讨论(0)
提交回复
热议问题