'module'对象没有属性'form_for_model' [英] 'module' object has no attribute 'form_for_model'
问题描述
当我使用属性
form_for_model
form_for_model
我收到错误模块对象没有属性form_for_model ..
I am getting an error module object has not attribute form_for_model..
我从这个 http://www.mikecantelon.com/?q=node/22
但是我得到以上可以帮助我的任何身体>
but I am getting the above can any body help me
推荐答案
你所指的帖子是相当老(2007),从那时起有一些改变:
form_for_model已被弃用。
The post you are referring to is fairly old (2007) and a few things have changed since then: form_for_model is deprecated.
我想说,你最好看看官方教程开始使用django。
I'd say you are better off looking at the official tutorial to get started with django.
在文档的这一部分中解释了基于模型创建表单的当前方式:
http://docs.djangoproject.com/en/1.8/topics/forms/modelforms/
The current way for creating forms based on models is explained in this part of the docs: http://docs.djangoproject.com/en/1.8/topics/forms/modelforms/
这篇关于'module'对象没有属性'form_for_model'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!