Skip to content

Instantly share code, notes, and snippets.

@seanupton
Created December 16, 2016 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanupton/581385d813ae5880ad504f11fc0ff7a4 to your computer and use it in GitHub Desktop.
Save seanupton/581385d813ae5880ad504f11fc0ff7a4 to your computer and use it in GitHub Desktop.
Monkey patch plone.autoform to make omitted fields exception for plone.schemaeditor listing
# monkey patch autoform to exempt schemaeditor from considering
# omitted fields
from plone.autoform import utils
from plone.autoform.interfaces import OMITTED_KEY
orig_mergedTaggedValuesForForm = utils.mergedTaggedValuesForForm
def mergedTaggedValuesForForm(schema, name, form):
if form.__class__.__name__ == 'SchemaListing' and name == OMITTED_KEY:
return {}
return orig_mergedTaggedValuesForForm(schema, name, form)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment