I am looking for a Django Forms replacement.
我在找一个Django表格的替代品。
I need auto-build form based on GAE Model as in Django. Django Forms work with some bugs on GAE. And I need to replace it.
我需要像Django那样基于GAE模型的自动构建表单。Django表单处理GAE上的一些错误。我需要替换它。
I have found WTForms. What is your choice?
我发现WTForms。你的选择是什么?
2 个解决方案
#1
2
WTForms is a good choice on GAE. It is similar to django forms.
在GAE上,WTForms是一个很好的选择。它类似于django表单。
Also note, other than the ModelForms
and the related types, django-forms
should work quite well on the GAE, out of the box. In fact, that is one of the reason why django is even supported on GAE, in the first place.
还要注意,除了模型表单和相关类型之外,django表单应该在GAE上工作得很好,而且是开箱即用的。事实上,这就是为什么django在GAE上得到支持的原因之一。
#2
0
I have looked for an answer to this as well.. And the only thing i can find is WTForms. WTForms comes with some integration towards translating models into forms. To be more specific, it has something called model_form found in wtforms.appengine.ext.model_form. With this you can make a form wit
我也在寻找这个问题的答案。我唯一能找到的就是WTForms。WTForms通过一些集成将模型转换为表单。更具体地说,它在wtforms.appengine.ext.model_form中有一个叫做model_form的东西。有了这个,你就能形成智慧。
form_obj = model_form(ModelClass)
#validate with
form = form_obj(request.POST)
if form.validate()
mc = ModelClass
form.populate_obj(mc)
mc.put()
It doesnt support the new ndb-module jet. But most stuff works with small code-changes.. Hope it helps.
它不支持新的ndb-module jet。但是大多数东西都是通过小的代码修改来工作的。希望它可以帮助。
#1
2
WTForms is a good choice on GAE. It is similar to django forms.
在GAE上,WTForms是一个很好的选择。它类似于django表单。
Also note, other than the ModelForms
and the related types, django-forms
should work quite well on the GAE, out of the box. In fact, that is one of the reason why django is even supported on GAE, in the first place.
还要注意,除了模型表单和相关类型之外,django表单应该在GAE上工作得很好,而且是开箱即用的。事实上,这就是为什么django在GAE上得到支持的原因之一。
#2
0
I have looked for an answer to this as well.. And the only thing i can find is WTForms. WTForms comes with some integration towards translating models into forms. To be more specific, it has something called model_form found in wtforms.appengine.ext.model_form. With this you can make a form wit
我也在寻找这个问题的答案。我唯一能找到的就是WTForms。WTForms通过一些集成将模型转换为表单。更具体地说,它在wtforms.appengine.ext.model_form中有一个叫做model_form的东西。有了这个,你就能形成智慧。
form_obj = model_form(ModelClass)
#validate with
form = form_obj(request.POST)
if form.validate()
mc = ModelClass
form.populate_obj(mc)
mc.put()
It doesnt support the new ndb-module jet. But most stuff works with small code-changes.. Hope it helps.
它不支持新的ndb-module jet。但是大多数东西都是通过小的代码修改来工作的。希望它可以帮助。