Django South - 将null = True字段转换为null = False字段 [英] Django South - turning a null=True field into a null=False field

查看:122
本文介绍了Django South - 将null = True字段转换为null = False字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,将 null = True 字段转换为 null = False 场使用Django南。具体来说,我正在使用一个 ForeignKey

My question is, what is the best practice for turning a null=True field into a null=False field using Django South. Specifically, I'm working with a ForeignKey.

推荐答案

先写一个数据迁移: http://south.aeracode.org/docs/tutorial/part3 .html
然后进行模式迁移。

You should write first a data migration: http://south.aeracode.org/docs/tutorial/part3.html and then make the schemamigration.

这篇关于Django South - 将null = True字段转换为null = False字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆