Guest User

Untitled

a guest
Jan 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. from Products.Archetypes.public import BooleanField
  2. from archetypes.schemaextender.field import ExtensionField
  3.  
  4. class DisplayEventTimeField(ExtensionField, BooleanField):
  5. """A toggle to indicate whether the view should display the time or just the date of this community event"""
  6.  
  7. from zope.component import adapts
  8. from zope.interface import implements
  9. from archetypes.schemaextender.interfaces import ISchemaExtender
  10. from Products.Archetypes.public import BooleanWidget
  11. from Products.ATContentTypes.interface import IATEvent
  12.  
  13. class EventExtender(object):
  14. adapts(IATEvent)
  15. implements(ISchemaExtender)
  16.  
  17.  
  18. fields = [
  19. DisplayEventTimeField("display_event_time",
  20. widget = BooleanWidget(
  21. label="Display event time",
  22. description="Turn this off to show only the event date (also disables iCal/vCal)",
  23. defult=True)),
  24. ]
  25.  
  26. def __init__(self, context):
  27. self.context = context
  28.  
  29. def getFields(self):
  30. return self.fields
Add Comment
Please, Sign In to add comment