Plone.autoform - object has no attribute __iro__

I am experimenting with making an object that is generated on the fly by SQLA behave along the lines of a regular Dexterity content type. My goal is to modernize example.trajectory.

My display view should iterate over all groups and widgets and use @@ploneform-render-widget to display the fields, rather than having to define each field manually, as is currently done in the view template

When I change the zcml configuration to use plone.dexterity.browser.view.DefaultView rather than the one in my package, Plone fails when rendering the page (traceback below).

My content type is set up just like my other regular content types, using an interface class with fields from model.Schema, and providing IFormFieldProvider. My object is an IDexterityContent adapter...

What am I missing here?

2022-06-10 13:20:34 ERROR Zope.SiteErrorLog 1654860034.420.81346211647 http://localhost:8585/mdb/invoic_in/21111224084/@@view
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module plone.autoform.view, line 40, in __call__
  Module plone.autoform.view, line 49, in _update
  Module plone.autoform.base, line 68, in updateFieldsFromSchemata
  Module plone.autoform.utils, line 263, in processFields
  Module plone.autoform.utils, line 69, in mergedTaggedValuesForForm
  Module plone.autoform.utils, line 50, in mergedTaggedValuesForIRO
  Module plone.supermodel.utils, line 279, in mergedTaggedValueList
AttributeError: type object 'InvoicIn' has no attribute '__iro__'

I'm still a bit confused on why my object does not have the __iro__ attribute, but apparently it is enough to hardcode it as an empty list.

[edit: split separate question here for clarity] My view now contains all the widgets, but does not provide their values unless I set those as properties in the wrapper. How do I avoid having to define dozens of properties for each of the new content types?

Norbert via Plone Community wrote at 2022-6-17 13:29 +0000:

I'm still a bit confused on why my object does not have the __iro__ attribute, but apparently it is enough to hardcode it as an empty list.

"iro" stands for "Interface Resolution Order" (the equivalent
of "mro" for interfaces).
Only interfaces typically have __iro__.

1 Like

Thank you @dieter for spelling it out to me. I had read these but the quarter didn't drop...

Turns out I had initially set my schema as the InvoicIn object in the Type XML, rather than
<property name="schema">pnz.erpediem.core.trajects.invoic_in.model.IInvoicIn</property>
The problem had already gone away after reinstalling my package, but I never realized this.

Still to resolve, how can I avoid having to define the value of each field?

Plone Foundation Code of Conduct