我只是試圖將我的生產服務器從Django 1.1.2遷移到Django 1.2.5。嘗試使用contenttypes保存模型時出現以下錯誤:save() got an unexpected keyword argument 'using'
我認爲這與遷移有關,但我無法弄清楚如何解決此問題。Django 1.1 - > 1.2遷移問題
Django的模型:
class RuleInput(models.Model):
rule = models.ForeignKey(Rule, related_name='inputs')
type = models.ForeignKey(ContentType, editable=False)
# A prio of 0 means a trigger, a prio of 1 means no trigger
priority = models.PositiveSmallIntegerField(max_length=100, default=0)
的節電功能:
models = ContentType.objects.filter(app_label="rules")
for model, args in inoutputs:
args['rule'] = rule
cls = models.get(model=model).model_class()
cls.objects.create(**args)
請粘貼相同的codenippet ...應該幫助 – 2011-04-08 13:40:19
看起來像你的'save'函數在參數列表中缺少'using' – Jerzyk 2011-04-08 14:26:09