This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
tabellio.agenda/tabellio/agenda/parlevent.py

53 lines
1.5 KiB
Python

from five import grok
from zope import schema
from zope.interface import implements
from z3c.relationfield.schema import RelationChoice
from Products.CMFCore.utils import getToolByName
import datetime
from plone.formwidget.contenttree import ObjPathSourceBinder
from themis.fields import LegisSession
from plone.app.textfield import RichText
from themis.datatypes.commission import ICommission
from tabellio.agenda.interfaces import MessageFactory as _
from event import IBaseEvent, BaseEvent, EventBaseView
class IParlEvent(IBaseEvent):
session = LegisSession(title=_(u'Session'))
order_of_the_day = RichText(title=_(u'Order of the day'), required=False)
cri = RelationChoice(title=_(u'Minutes'), required=False,
source=ObjPathSourceBinder())
class ParlEvent(BaseEvent):
implements(IParlEvent)
def klass(self):
return 'parlementary-event'
class ParlEventBaseView(EventBaseView):
def next_event_url(self):
return EventBaseView.next_event_url(self,
portal_type=('tabellio.agenda.parlevent',
'tabellio.agenda.comevent'))
def previous_event_url(self):
return EventBaseView.previous_event_url(self,
portal_type=('tabellio.agenda.parlevent',
'tabellio.agenda.comevent'))
def has_stream(self):
# XXX
return False
class View(grok.View, ParlEventBaseView):
grok.context(IParlEvent)
grok.require('zope2.View')