archetypes.markerfield 1.1

Interface marker field for Archetypes
archetypes.markerfield is a Plone product that contains a single Archetypes field that can manage one or more marker interface on an object.

It is most often used with archetypes.schemaextender to add a field to a type which controls new optional behaviour.

Example


This example adds a new item to the settings fieldset for an object which controls an ICategory marker interface:

class FolderExtender(object):
 """Add a new 'category' field to all Archetypes based folder types.
 """
 adapts(IBaseFolder)
 implements(ISchemaExtender)

 fields = [
 InterfaceMarkerField("category",
 schemata = "settings",
 interfaces = (ICategory,),
 widget = BooleanWidget(
 title = _(u"label_category",
 default=u"Is this folder a category."),
 description = _(u"help_category",
 default=u"This should briefly explain what "
 u"categories are used for."),
 ),
 ),
 ]


 def __init__(self, context):
 self.context = context


 def getFields(self):
 return self.fields

last updated on:
April 8th, 2011, 20:46 GMT
price:
FREE!
developed by:
Wichert Akkertman
license type:
ZPL (Zope Public License) 
category:
ROOT \ Internet \ Plone Extensions

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

What's New in This Release:
  • Extracted a non-schemaextender version of the field to its own class. [hannosch]
  • PEP8 cleanup. [hannosch]
read full changelog

Add your review!

SUBMIT