在 Django 中通过 admin 生成表单

发布于 2024-09-03 00:35:35 字数 350 浏览 1 评论 0原文

我需要能够从管理面板创建表单。流程如下所示: 我单击“添加表单”,然后输入表单应发送到的电子邮件,当然还有几个字段(可能感谢内联),其中包括字段名称、类型以及是否需要。用户应该能够查看并填写表格并提交,并且数据应发送到管理员中提供的电子邮件。

一切看起来都非常简单,但从我的角度来看,它需要一些元类编程技能。

谁能给我指出一个 Django 的优秀表单构建器,或者至少提供一些关于创建此类东西的技巧?我找到了 django-forms-builder 但恕我直言,它有点太受限了。

I need to be able to create forms from admin panel. Process would look like this:
I click on "Add form" then I enter email to which the form should be sent and of course several fields (probably thanks to inlines) consisting of field name, type and if it is required. User should be able to view and fill the form and submit it and the data should be sent to the email given in admin.

Everything looks pretty straightforward but from my point of view it need some metaclass programming skills.

Could anyone point me to a goot form builder for Django or at least hand some tips about creating such thing? I found django-forms-builder but it is a bit too restricted imho.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

始终不够 2024-09-10 00:35:36

我知道这个已经有几个月了,但我只是想无论如何我都会在这里为其他人发布更新。

django-forms-builder 刚刚被重写,以完全满足您最初发布此问题时所寻找的功能。

您可以在 http://github.com/stephenmcd/django-forms-builder< 找到新版本/a> 或 http://bitbucket.org/stephenmcd/django-forms-builder

I know this one's a few months old but I just though I'd post an update here anyway for anyone else that comes along.

django-forms-builder has just been rewritten to do exactly what you were looking for when you originally posted this question.

You can find the new version at http://github.com/stephenmcd/django-forms-builder or http://bitbucket.org/stephenmcd/django-forms-builder

归属感 2024-09-10 00:35:36

有很多替代方案,尽管其中得到积极维护的并不多:

https://www .djangopackages.com/grids/g/form-b​​uilder/

如果您想完全控制正在发生的事情(根据您的需要更改字段或添加新字段,添加验证码或蜜罐,添加表单数据的自定义处理,使用表单向导,甚至通过 Web REST API 使用表单),使用 django-fobi https://pypi.python.org/pypi/django-fobi

There are many alternatives, although not many of them are actively maintained:

https://www.djangopackages.com/grids/g/form-builder/

If you want to have a full control of what's happening (change fields for your needs or add new ones, add captcha or honeypot, add custom handling of form data, use form wizards or even use your forms via web REST API), use django-fobi https://pypi.python.org/pypi/django-fobi

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文