Does PloneFormGen function correctly with Python3?

According to
https://code.activestate.com/pypm/products.ploneformgen/
it is not yet ready for Python3. But can I trust that site?
Also here


Python3 is not mentioned.

Is Products.PloneFormGen known to work with Plone 5.2.1 and Python 3.7?

I don't know if you can trust that site, but it is a bit outdated: it says the latest version is 1.7.12 from June 21st, 2013. But the real latest is 1.8.7, from November 2019.

Anyway, PloneFormGen works on Plone 5.2 with Python 2.7, but it does not work with Python 3.7.
PloneFormGen is based on Archetypes content types, which is old and will never work with Python 3.

For an alternative, please look at collective.easyform. That is basically a copy of PloneFormGen but based on the newer Dexterity content types. It works on Python 2 and 3.

2 Likes

Good to know. I'll try easyform. Thank you!

Please don't – the canonical site is https://pypi.org.

I've now installed easyform in Plone 5.2.1 (Python 3.7.3)

eggs =
    Plone
    Pillow
    collective.easyform [recaptcha]
    Products.PloneHotfix20200121

When I tried to add a recaptca field to my form, it says: "Info: Field added successfully" and on the same page I get
"We’re sorry, but there seems to be an error…"
and the message below.

What is wrong? I cannot access the form anymore.

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 156, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 338, in publish_module
  Module ZPublisher.WSGIPublisher, line 256, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 62, in call_object
  Module plone.z3cform.layout, line 63, in __call__
  Module plone.z3cform.layout, line 57, in update
  Module plone.schemaeditor.browser.schema.listing, line 59, in render
  Module z3c.form.form, line 163, in render
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 61, in __call__
  Module zope.pagetemplate.pagetemplate, line 135, in pt_render
  Module Products.PageTemplates.engine, line 88, in __call__
  Module z3c.pt.pagetemplate, line 173, in render
  Module chameleon.zpt.template, line 306, in render
  Module chameleon.template, line 187, in render
  Module fe2694026c41ca1adab0b590c8a1e343.py, line 930, in render
  Module 69229c4a5b99a60089ac8118a0290d2c.py, line 168, in render_form
  Module 69229c4a5b99a60089ac8118a0290d2c.py, line 768, in render_titlelessform
  Module fe2694026c41ca1adab0b590c8a1e343.py, line 883, in __fill_fields
  Module Products.PageTemplates.expression, line 101, in __call__
  Module zope.browserpage.simpleviewclass, line 41, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 81, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 49, in __call__
  Module zope.pagetemplate.pagetemplate, line 135, in pt_render
  Module Products.PageTemplates.engine, line 88, in __call__
  Module z3c.pt.pagetemplate, line 173, in render
  Module chameleon.zpt.template, line 306, in render
  Module chameleon.template, line 187, in render
  Module 66bf3e820b44fddfb1a49c04d8557e4d.py, line 628, in render
  Module 66bf3e820b44fddfb1a49c04d8557e4d.py, line 494, in render_widget_wrapper
  Module Products.PageTemplates.expression, line 101, in __call__
  Module z3c.form.widget, line 154, in render
  Module zope.browserpage.viewpagetemplatefile, line 49, in __call__
  Module zope.pagetemplate.pagetemplate, line 135, in pt_render
  Module Products.PageTemplates.engine, line 88, in __call__
  Module z3c.pt.pagetemplate, line 173, in render
  Module chameleon.zpt.template, line 306, in render
  Module chameleon.template, line 209, in render
  Module chameleon.utils, line 75, in raise_with_traceback
  Module chameleon.template, line 187, in render
  Module 514762037a3b8f10242aebe49789ba51.py, line 93, in render
  Module Products.PageTemplates.expression, line 94, in __call__
  Module Products.PageTemplates.expression, line 62, in traverse
  Module OFS.Traversable, line 350, in unrestrictedTraverse
   - __traceback_info__: ([], '@@recaptcha')
  Module OFS.Traversable, line 244, in unrestrictedTraverse
   - __traceback_info__: ([], '@@recaptcha')
AttributeError: @@recaptcha

 - Expression: "context/@@recaptcha/image_tag"
 - Filename:   ... cha-2.2.0-py3.7.egg/plone/formwidget/recaptcha/widget.pt
 - Location:   (line 1: col 34)
 - Source:     ... replace="structure context/@@recaptcha/image_tag"/>
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Expression: "widget/render"
 - Filename:   ... rm-3.1.3-py3.7.egg/plone/app/z3cform/templates/widget.pt
 - Location:   (line 39: col 46)
 - Source:     ... xt" tal:replace="structure widget/render"
                                              ^^^^^^^^^^^^^
 - Expression: "id view"
 - Filename:   ... rm-3.1.3-py3.7.egg/plone/app/z3cform/templates/macros.pt
 - Location:   (line 70: col 38)
 - Source:     id view/id;
               ^^^^^^^
 - Expression: "context/@@ploneform-macros/form"
 - Filename:   ... -py3.7.egg/collective/easyform/browser/fields_listing.pt
 - Location:   (line 7: col 31)
 - Source:     ... metal:use-macro="context/@@ploneform-macros/form">
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  template: <ViewPageTemplateFile - at 0x7fd3100de320>
               options: {...} (0)
               args: <tuple - at 0x7fd3192ee048>
               nothing: <NoneType - at 0x820690>
               modules: <TraversableModuleImporter - at 0x7fd318847f98>
               request: <WSGIRequest - at 0x7fd3094cc358>
               view: <ReCaptchaWidget spam_protection at 0x7fd3082ba550>
               context: <ImplicitAcquisitionWrapper fields at 0x7fd309e28c60>
               views: <ViewMapper - at 0x7fd302d90358>
               default: <object - at 0x7fd3192cab40>
               repeat: {...} (0)
               loop: {...} (0)
               wrapped_repeat: {...} (0)
               target_language: <NoneType - at 0x820690>
               translate: <function translate at 0x7fd302fa6268>

Looks like you've got to register the reCaptcha to work. See the reCaptcha section here