You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We support several field-level tags (at schema definition), but is both error-prone and difficult to document all these options as tags. Maybe hide them under patched Field methods, so that they are documented as "extended" Field methods.
E.g:
classTagDefinition(object):
classTag(object):
def__init__(self, field):
self.field=field# Provide methods for actual configuration deflink_to(self, name):
self.field.setTaggedValue('links-to', name)
defformat(self, name, opts):
self.field.setTaggedValue('format:%s'%name, opts)
def__init__(self): passdef__get__(self, field, fieldtype=None):
returnself.Tag(field)
def__set__(self, field, value):
raiseAttributeError('Not meant to be set')
# Patch with a config descriptor: Let the monkeys go wildField.config=TagDefinition()
classIFoo(Interface):
# Tag actual fieldsabstract=zope.schema.Text(title=u'Abstract')
abstract.config.link_to("notes")
abstract.config.format("markup", {'descend': False})
The text was updated successfully, but these errors were encountered:
We support several field-level tags (at schema definition), but is both error-prone and difficult to document all these options as tags. Maybe hide them under patched
Field
methods, so that they are documented as "extended"Field
methods.E.g:
The text was updated successfully, but these errors were encountered: