def context_is_public(context): """Is the context public i.e. can Anonymous see it? !+ logic here is now incorrect !!! """ state = get_object_state(context) # also return False for None (Unset) return bool(state.getSetting("zope.View", "bungeni.Anonymous"))
def context_parent_is_draft(context): """Is parent context in a draft state? A doc is a draft iff its current current state is tagged with "draft". """ parent_state = get_object_state(context.head) return "draft" in parent_state.tags
def version_increment_for_state(context): """Return 0 or 1, depending on whether the current workflow state defines a version="true". """ state = get_object_state(context) return int(ACTIONS_MODULE.create_version in state.actions)
def status(self): status_title = get_object_state(self.context).title request = get_request() return translate(_(status_title), context=request)
def version_increment_for_state(context): """Return 0 or 1, depending on whether the current workflow state defines a version="true". """ state = get_object_state(context) return int(ACTIONS_MODULE.version in state.actions)