ploneintranet.todo package¶
Subpackages¶
Submodules¶
ploneintranet.todo.behaviors module¶
-
interface
ploneintranet.todo.behaviors.
IMilestone
¶ Bases:
plone.supermodel.model.Schema
A text field representing the milestone associated with this todo item. For example, the id of the associated workflow state of the container.
-
milestone
= <zope.schema._bootstrapfields.TextLine object>¶ Milestone
-
-
interface
ploneintranet.todo.behaviors.
IMilestoneMarker
¶ Bases:
zope.interface.Interface
Marker interface that will be provided by instances using the IMilestone behavior.
-
interface
ploneintranet.todo.behaviors.
IMustRead
¶ Bases:
plone.supermodel.model.Schema
MustRead schema
-
mustread
= <zope.schema._bootstrapfields.Bool object>¶ Must read
Mark the content as “Must read” for all users.
-
-
interface
ploneintranet.todo.behaviors.
IMustReadMarker
¶ Bases:
zope.interface.Interface
Marker interface that will be provided by instances using the IMustRead behavior.
-
interface
ploneintranet.todo.behaviors.
ITodo
¶ Bases:
plone.supermodel.model.Schema
Todo schema
-
priority
= <zope.schema._field.Choice object>¶ Priority
-
assignee
= <zope.schema._bootstrapfields.TextLine object>¶ Assignee
A user (or a group) assigned to this task
-
initiator
= <zope.schema._bootstrapfields.TextLine object>¶ Initiator
The user (or group) who requested this task
-
description
= <zope.schema._bootstrapfields.Text object>¶ Long description
-
due
= <zope.schema._field.Date object>¶ Due date
-
-
interface
ploneintranet.todo.behaviors.
ITodoMarker
¶ Bases:
zope.interface.Interface
Marker interface that will be provided by instances using the ITodo behavior.
ploneintranet.todo.handlers module¶
-
ploneintranet.todo.handlers.
_is_change_reported
(event, field)¶
-
ploneintranet.todo.handlers.
mark
(obj, evt)¶ The event handler that marks this object as mustread.
-
ploneintranet.todo.handlers.
on_delete
(obj, evt)¶ Complete actions for objects marked as must read that have been deleted
-
ploneintranet.todo.handlers.
task_update_handler
(obj, event)¶ - when a task is created the assignee gets a notification
- when a task is edited assignee and initiator get notifications
- when a task is state changed assignee and initiator get notifications
always - the one who did the changes does not get a notification
-
ploneintranet.todo.handlers.
todo_set_role
(obj, evt)¶ update role for assignees
-
ploneintranet.todo.handlers.
trigger_user_notifications
(obj, recipient, mail_template='')¶ Send out notifications to all channels the user wants
ploneintranet.todo.interfaces module¶
Module where all interfaces, events and exceptions live.
-
interface
ploneintranet.todo.interfaces.
IContentAction
¶ Bases:
zope.interface.Interface
Interface for ContentAction class
-
verb
= <zope.interface.interface.Attribute object>¶ The action to be taken on the content
-
created
= <zope.interface.interface.Attribute object>¶ The datetime this ContentAction was created
-
completed
= <zope.interface.interface.Attribute object>¶ The datetime this ContentAction was completed
-
content_uid
= <zope.interface.interface.Attribute object>¶ The UID of the content that needs actioning
-
userid
= <zope.interface.interface.Attribute object>¶ The userid this action is for
-
modified
= <zope.interface.interface.Attribute object>¶ The datetime this ContentAction was triggered
-
-
interface
ploneintranet.todo.interfaces.
IMilestoneNameResolver
¶ Bases:
zope.interface.Interface
Interface for an adapter that resolves a milestone id into a name
-
resolve
(milestone_id)¶ Given a mileston_id returns a name or an empty string if it cannot be resolved
Parameters: milestone_id (str) – a milestone id Returns: The resolved milestone name or an empty string Return type: str
-
-
interface
ploneintranet.todo.interfaces.
ITodoApp
¶ Bases:
ploneintranet.layout.app.IApp
Marker interface for the todo app
-
app_url
()¶ The absolute URL of the app, based on self.app.
-
css_class
= <zope.schema._field.ASCIILine object>¶ app_class_label
app_class_description
-
app
= <zope.schema._field.ASCIILine object>¶ app_label
app_description
-
devices
= <zope.schema._field.ASCIILine object>¶ app_devices_label
app_devices_description
-
app_view
(request)¶ Return the actual view as indicated by self.app, with self.app_parameters applied to the request.
-
external
= <zope.schema._bootstrapfields.Bool object>¶ app_external_label
app_external_description
-
condition
= <zope.schema._field.ASCIILine object>¶ app_condition_label
app_condition_description
-
app_parameters
= <zope.schema._bootstrapfields.Text object>¶ app_parameters_label
app_parameters_description
-
-
interface
ploneintranet.todo.interfaces.
ITodoUtility
¶ Bases:
zope.interface.Interface
Interface for the TodoUtility
-
add_action
(content_uid, verb, userids=None, completed=False)¶ Add the given action for the given content to the given users, or all users. If completed is True then this is an action that has occurred (for example “Liking” content) rather than an action that needs to be take in the future
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to take
- userids (str or list or None) – The userids to add the action to or None for all users
- completed (bool) – Whether this is a pre-completed action
-
complete_action
(content_uid, verb, userids=None)¶ Mark the given action for the given content as complete for the given users
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to complete
- userids (list or None) – The userids to complete the action from or None for all users
-
remove_action
(content_uid, verb, userids=None)¶ Remove the given action from the users’ actions. This is normally for admin use, but also for removing pre-completed actions
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to complete
- userids (list or None) – The userids to complete the action from or None for all users
-
query
(userids=None, verbs=None, content_uids=None, sort_on=None, sort_order=None, ignore_completed=True)¶ Query the action storage for ContentActions matching the given query. Results are AND’d together
Parameters: - userids (list or str or None) – UserIDs to lookup
- verbs (list or str or None) – Action verb to lookup
- content_uids (list or str or None) – Content UIDs to lookup
- sort_on (str) – Field to sort on (created, completed, verb)
- sort_order (str or None) – Whether to reverse the sort order (‘reverse’)
- ignore_completed (bool) – Whether to exclude completed actions from the results
Returns: List of ContentActions
Return type: class: ContentAction
-
ploneintranet.todo.testing module¶
ploneintranet.todo.todo_utility module¶
-
class
ploneintranet.todo.todo_utility.
TodoUtility
¶ Bases:
object
-
static
_all_users
()¶ Get all userids for the site
Returns: The userids of all site users Return type: list
-
_create_user_storage
(userid)¶ Initialise user’s ContentAction storage
Parameters: userid (str) – The userid to initialise
-
_get_action_for_user
(content_uid, verb, users_actions)¶
-
static
_get_storage
()¶ Look up storage for tokens
Returns: action storage
-
_user_in_storage
(userid)¶ Does the given userid exist in the annotation storage?
Parameters: userid (str) – The userid to check Returns: Whether the userid is in storage or not Return type: bool
-
add_action
(content_uid, verb, userids=None, completed=False)¶ Add the given action for the given content to the given users, or all users. If completed is True then this is an action that has occurred (for example “Liking” content) rather than an action that needs to be take in the future
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to take
- userids (str or list or None) – The userids to add the action to or None for all users
- completed (bool) – Whether this is a pre-completed action
-
complete_action
(content_uid, verb, userids=None)¶ Mark the given action for the given content as complete for the given users
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to complete
- userids (list or str or None) – The userids to complete the action from or None for all users
-
query
(userids=None, verbs=None, content_uids=None, sort_on=None, sort_order=None, ignore_completed=True)¶ Query the action storage for ContentActions matching the given query. Results are AND’d together
Parameters: - userids (list or str or None) – UserIDs to lookup
- verbs (list or str or None) – Action verb to lookup
- content_uids (list or str or None) – Content UIDs to lookup
- sort_on (str) – Field to sort on (created, completed, verb)
- sort_order (str or None) – Whether to reverse the sort order (‘reverse’)
- ignore_completed (bool) – Whether to exclude completed actions from the results
Returns: List of ContentActions
Return type: class: ContentAction
-
remove_action
(content_uid, verb, userids=None)¶ Remove the given action from the users’ actions. This is normally for admin use, but also for removing pre-completed actions
Parameters: - content_uid (str) – The UID of the content
- verb (str) – The action to complete
- userids (list or None) – The userids to complete the action from or None for all users
-
static