Introspect a TTW-created Dexterity type?

If a dexterity content type is created using just TTW with the dexterity schema editor, how can the type be introspected in Python code by its name? I tried querying the FTI for schema and model but they seem to be empty.

I think this snippet will work for all DX types:

    obj = brain.getObject()
    for schemata in iterSchemata(obj):
        for fieldname, field in getFieldsInOrder(schemata):
            try:
                value = field.get(schemata(obj))
            except AttributeError:
                continue
            if value is field.missing_value:
                continue

            field_type = field.__class__.__name__

1 Like

See plone.restapi

1 Like

Thanks @zopyx & @avoinea !

Plone Foundation Code of Conduct