Skip to content

Instantly share code, notes, and snippets.

Last active Sep 11, 2015
What would you like to do?
import zope.interface
import zope.schema.interfaces
import z3c.form.interfaces
import z3c.form.browser.textarea
import z3c.form.widget
from import RelatedItemsWidget
class MyRelatedItemsWidget(RelatedItemsWidget):
def _base_args(self):
args = super(MyRelatedItemsWidget, self)._base_args()
args['pattern_options']['selectableTypes'] = ['SomeType']
args['pattern_options']['baseCriteria'] = [{
'i': 'portal_type',
'o': '',
'v': ['SomeType', 'Folder']
return args
def MyRelatedItemFieldWidget(field, request):
widget = z3c.form.widget.FieldWidget(field,
widget.vocabulary = ''
return widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment