[SOLVED] DataGridField error: TypeError: There is no persistent field equivalent for the field `targets` of type `List`

I have this field definition (used the same a trillion times in other projects) in a schema of a controlpanel form which give me the attached error...anything missing here?

class ITargetRow(Interface):
    key = schema.TextLine(title="foo")
    bar = schema.TextLine(title="bar")


class lass ISettings(model.Schema):

    directives.widget(targets=DataGridFieldFactory)
    targets = schema.List(
        description=_(u"Synchronization targets"),
        required=False,
        title=_(u"Targets"),
        default=[],
        value_type=DictRow(title="row", schema=ITargetRow)
    )
    

  File "/home/ajung/.buildout/eggs/Products.CMFPlone-5.2.3-py3.8.egg/Products/CMFPlone/factory.py", line 175, in addPloneSite
    setup_tool.runAllImportStepsFromProfile(
  File "/home/ajung/.buildout/eggs/Products.GenericSetup-2.0.3-py3.8.egg/Products/GenericSetup/tool.py", line 394, in runAllImportStepsFromProfile
    result = self._runImportStepsFromContext(
  File "/home/ajung/.buildout/eggs/Products.GenericSetup-2.0.3-py3.8.egg/Products/GenericSetup/tool.py", line 1478, in _runImportStepsFromContext
    message = self._doRunImportStep(step, context)
  File "/home/ajung/.buildout/eggs/Products.GenericSetup-2.0.3-py3.8.egg/Products/GenericSetup/tool.py", line 1290, in _doRunImportStep
    return handler(context)
  File "/home/ajung/.buildout/eggs/plone.app.registry-1.7.7-py3.8.egg/plone/app/registry/exportimport/handler.py", line 79, in importRegistry
    importer.importDocument(body)
  File "/home/ajung/.buildout/eggs/plone.app.registry-1.7.7-py3.8.egg/plone/app/registry/exportimport/handler.py", line 127, in importDocument
    self.importRecords(node)
  File "/home/ajung/.buildout/eggs/plone.app.registry-1.7.7-py3.8.egg/plone/app/registry/exportimport/handler.py", line 391, in importRecords
    self.context.registerInterface(
  File "/home/ajung/.buildout/eggs/plone.registry-1.1.6-py3.8.egg/plone/registry/registry.py", line 104, in registerInterface
    raise TypeError(
TypeError: There is no persistent field equivalent for the field `targets` of type `List`.

Possibly answered here? There is no persistent field equivalent for the field 'A' of type `B`

nope :slight_smile:

Looking here: https://github.com/collective/collective.z3cform.datagridfield#id10 What you are doing should work since your value type is a DictRow...

Wait... are you importing from collective.z3cform.datagridfield.registry ?

Like here:

Thanks..this works

Plone Foundation Code of Conduct