From cf93ec49d730870d5bdf0d902c8dd63cda8a0e97 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 11 Jan 2009 11:13:10 +0000 Subject: [PATCH] work in progress: new work item lifecycle git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3135 fd906abe-77d9-0310-91a1-e0d9ade77398 --- organize/work.py | 4 ++++ organize/work.txt | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/organize/work.py b/organize/work.py index 6f51dbf..d5c0be8 100644 --- a/organize/work.py +++ b/organize/work.py @@ -177,6 +177,10 @@ class WorkItem(Stateful, Track): for k in self.initAttributes: v = kw.get(k, _not_found) if v is _not_found: + if action == 'start' and k in ('end',): + continue + if action in ('stop', 'finish') and k in ('duration', 'effort',): + continue v = self.data.get(k) if v is not None: newData[k] = v diff --git a/organize/work.txt b/organize/work.txt index d2169ef..5b2ba02 100644 --- a/organize/work.txt +++ b/organize/work.txt @@ -98,8 +98,7 @@ but may also be specified explicitly. >>> wi03 = wi02.doAction('start', start=1229958000) >>> wi03 + {'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}> Stopping and finishing work --------------------------- @@ -110,8 +109,15 @@ continue work later, so he executes a ``stop`` action. >>> wi04 = wi03.doAction('stop', end=1229958300) >>> wi04 + {'start': 1229958000, 'created': ..., 'end': 1229958300, 'creator': 'jim'}> + +After another hour Jim works again on the task; he now finishes it within +ten minutes and records this in one step. + + >>> wi05 = wi04.doAction('finish', start=1229961600, end=1229967200) + >>> wi05 + Closing work ------------ @@ -119,7 +125,7 @@ Closing work Let's now check how many work items have been generated. >>> len(list(workItems)) - 4 + 5 Delegation of Work Items