0
升级到较新的Django版本后,我开始这个弃用警告:如何解决django的db_type deprecation警告?
Django version 1.3, using settings 'demos.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
/Users/.....myfile.py:328: DeprecationWarning: inner has been called without providing a connection argument.
if 'integer' in x.db_type()
我意识到它是由Field.db_type方法,该方法返回一个领域的数据库中列的数据类型引起的。该方法已被修改,以符合了最新版本的Django的多数据库功能,所以现在还需要一个连接对象作为参数 [check the django docs]
但如何通过该连接对象?我不明白它..