在django中重复使用用户视图的管理表单? [英] Reusing Admin forms for user views in django?

查看:85
本文介绍了在django中重复使用用户视图的管理表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建一个models.py和一个admin.py之后,Django正在制作非常好的表单。



如何在我自己的意见中重用这些表单(具有非常好的处理外键和多对多字段)?



ModelForm只生成简单形式。我在哪里可以获得额外的电池?

解决方案

我实际上能够按照我的表格中的指示复制这些绿色按钮本页面: http://www.hoboes.com/Mimsy/hacks/ replicating-djangos-admin /


Django is making very nice forms after creating a models.py and an admin.py.

How can I reuse these forms (with the extra nice handling of foreign keys and many-to-many fields) in my own views?

ModelForm does only generate "simple" forms. Where do I get the extra batteries?

解决方案

I was actually able to replicate those green buttons in my forms by following the instructions on this page: http://www.hoboes.com/Mimsy/hacks/replicating-djangos-admin/

这篇关于在django中重复使用用户视图的管理表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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