“模块"对象没有属性“form_for_model" [英] 'module' object has no attribute 'form_for_model'

查看:20
本文介绍了“模块"对象没有属性“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= 创建了这个项目节点/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/模型形式/

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/

这篇关于“模块"对象没有属性“form_for_model"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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