Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Products.Archetypes.public import BooleanField
- from archetypes.schemaextender.field import ExtensionField
- class DisplayEventTimeField(ExtensionField, BooleanField):
- """A toggle to indicate whether the view should display the time or just the date of this community event"""
- from zope.component import adapts
- from zope.interface import implements
- from archetypes.schemaextender.interfaces import ISchemaExtender
- from Products.Archetypes.public import BooleanWidget
- from Products.ATContentTypes.interface import IATEvent
- class EventExtender(object):
- adapts(IATEvent)
- implements(ISchemaExtender)
- fields = [
- DisplayEventTimeField("display_event_time",
- widget = BooleanWidget(
- label="Display event time",
- description="Turn this off to show only the event date (also disables iCal/vCal)",
- defult=True)),
- ]
- def __init__(self, context):
- self.context = context
- def getFields(self):
- return self.fields
Add Comment
Please, Sign In to add comment