Example #1
0
def getWorkSpacePISection(workspace):
    """ /workspace/obj-id/pi -> non-ARCHIVED parliamentary items
    """
    s = Section(title=_(u"Parliamentary items"),
                description=_(u"Current parliamentary activity"),
                default_name="workspace-pi")
    interface.alsoProvides(s, interfaces.IWorkspacePIContext)
    s.__parent__ = workspace
    s.__name__ = "pi"
    s["questions"] = QueryContent(
        container_getter(workspace,
                         'questions',
                         query_modifier=sql.not_(
                             domain.Question.status.in_(ARCHIVED))),
        #title=_(u"Questions"),
        description=_(u"Questions"))
    s["motions"] = QueryContent(
        container_getter(workspace,
                         'motions',
                         query_modifier=sql.not_(
                             domain.Motion.status.in_(ARCHIVED))),
        #title=_(u"Motions"),
        description=_(u"Motions"))
    s["tableddocuments"] = QueryContent(
        container_getter(workspace,
                         'tableddocuments',
                         query_modifier=sql.not_(
                             domain.TabledDocument.status.in_(ARCHIVED))),
        #title=_(u"Tabled documents"),
        description=_(u"Tabled documents"))
    s["bills"] = QueryContent(
        container_getter(workspace,
                         'bills',
                         query_modifier=sql.not_(
                             domain.Bill.status.in_(ARCHIVED))),
        #title=_(u"Bills"),
        description=_(u"Bills"))
    s["agendaitems"] = QueryContent(
        container_getter(workspace,
                         'agendaitems',
                         query_modifier=sql.not_(
                             domain.AgendaItem.status.in_(ARCHIVED))),
        #title=_(u"Agenda items"),
        description=_(u" items"))
    s["committees"] = QueryContent(
        container_getter(workspace, 'committees'),
        #title=_(u"Committees"),
        description=_(u"Committees"))
    log.debug("WorkspacePISection %s" % debug.interfaces(s))
    return s
Example #2
0
def getWorkSpaceArchiveSection(workspace):
    """ /workspace/obj-id/my-archive/ -> ARCHIVED parliamentary items 
    """
    s = Section(title=_(u"My archive"),
                description=_(u"My archive personal items"),
                default_name="workspace-archive")
    interface.alsoProvides(s, interfaces.IWorkspaceArchiveContext)
    s.__parent__ = workspace
    s.__name__ = "archive"
    s["questions"] = QueryContent(
        container_getter(workspace,
                         'questions',
                         query_modifier=domain.Question.status.in_(ARCHIVED)),
        #title=_(u"Questions"),
        description=_(u"Questions"))
    s["motions"] = QueryContent(
        container_getter(workspace,
                         'motions',
                         query_modifier=domain.Motion.status.in_(ARCHIVED)),
        #title=_(u"Motions"),
        description=_(u"Motions"))
    s["tableddocuments"] = QueryContent(
        container_getter(
            workspace,
            'tableddocuments',
            query_modifier=domain.TabledDocument.status.in_(ARCHIVED)),
        #title=_(u"Tabled documents"),
        description=_(u"Tabled documents"))
    s["bills"] = QueryContent(
        container_getter(workspace,
                         'bills',
                         query_modifier=domain.Bill.status.in_(ARCHIVED)),
        #title=_(u"Bills"),
        description=_(u"Bills"))
    s["agendaitems"] = QueryContent(
        container_getter(
            workspace,
            'agendaitems',
            query_modifier=domain.AgendaItem.status.in_(ARCHIVED)),
        #title=_(u"Agenda items"),
        description=_(u" items"))
    log.debug("getWorkSpaceArchiveSection %s" % debug.interfaces(s))
    return s
Example #3
0
def getWorkSpacePISection(workspace):
    """ /workspace/obj-id/pi -> non-ARCHIVED parliamentary items
    """
    s = Section(title=_(u"Parliamentary items"),
            description=_(u"Current parliamentary activity"),
            default_name="workspace-pi")
    interface.alsoProvides(s, interfaces.IWorkspacePIContext)
    s.__parent__ = workspace
    s.__name__ = "pi"
    s["questions"] = QueryContent(
            container_getter(workspace, 'questions',
            query_modifier=sql.not_(domain.Question.status.in_(ARCHIVED))),
            #title=_(u"Questions"),
            description=_(u"Questions"))
    s["motions"] = QueryContent(
            container_getter(workspace, 'motions',
                query_modifier=sql.not_(domain.Motion.status.in_(ARCHIVED))),
            #title=_(u"Motions"),
            description=_(u"Motions"))
    s["tableddocuments"] = QueryContent(
            container_getter(workspace, 'tableddocuments',
                query_modifier=sql.not_(domain.TabledDocument.status.in_(ARCHIVED))),
            #title=_(u"Tabled documents"),
            description=_(u"Tabled documents"))
    s["bills"] = QueryContent(
            container_getter(workspace, 'bills',
                query_modifier=sql.not_(domain.Bill.status.in_(ARCHIVED))),
            #title=_(u"Bills"),
            description=_(u"Bills"))
    s["agendaitems"] = QueryContent(
            container_getter(workspace, 'agendaitems',
                query_modifier=sql.not_(domain.AgendaItem.status.in_(ARCHIVED))),
            #title=_(u"Agenda items"),
            description=_(u" items"))
    s["committees"] = QueryContent(
            container_getter(workspace, 'committees'),
            #title=_(u"Committees"),
            description=_(u"Committees"))
    log.debug("WorkspacePISection %s" % debug.interfaces(s))
    return s
Example #4
0
def getWorkSpaceArchiveSection(workspace):
    """ /workspace/obj-id/my-archive/ -> ARCHIVED parliamentary items 
    """
    s = Section(title=_(u"My archive"),
            description=_(u"My archive personal items"),
            default_name="workspace-archive")
    interface.alsoProvides(s, interfaces.IWorkspaceArchiveContext)
    s.__parent__ = workspace
    s.__name__ = "archive"
    s["questions"] = QueryContent(
            container_getter(workspace, 'questions',
                query_modifier=domain.Question.status.in_(ARCHIVED)),
            #title=_(u"Questions"),
            description=_(u"Questions"))
    s["motions"] = QueryContent(
            container_getter(workspace, 'motions',
                query_modifier=domain.Motion.status.in_(ARCHIVED)),
            #title=_(u"Motions"),
            description=_(u"Motions"))
    s["tableddocuments"] = QueryContent(
            container_getter(workspace, 'tableddocuments',
                query_modifier=domain.TabledDocument.status.in_(ARCHIVED)),
            #title=_(u"Tabled documents"),
            description=_(u"Tabled documents"))
    s["bills"] = QueryContent(
            container_getter(workspace, 'bills',
                query_modifier=domain.Bill.status.in_(ARCHIVED)),
            #title=_(u"Bills"),
            description=_(u"Bills"))
    s["agendaitems"] = QueryContent(
            container_getter(workspace, 'agendaitems',
                query_modifier=domain.AgendaItem.status.in_(ARCHIVED)),
            #title=_(u"Agenda items"),
            description=_(u" items"))
    log.debug("getWorkSpaceArchiveSection %s" % debug.interfaces(s))
    return s