From b7186a04cfecae9de25444ac9137f01f11d64db9 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 15 Jan 2015 22:08:13 +0100 Subject: [PATCH] Task: Make modified property non-private This is actually useful to have open to public. For modify hooks, you get two lines of input(original and modified version), so it's quite useful to have a convenient way of checking whether the task you got is modified or not. --- tasklib/task.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasklib/task.py b/tasklib/task.py index f21ea43..ec3de29 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -280,7 +280,7 @@ class Task(TaskResource): yield key @property - def _is_modified(self): + def modified(self): return bool(list(self._modified_fields)) @property @@ -373,7 +373,7 @@ class Task(TaskResource): self.refresh(only_fields=['status']) def save(self): - if self.saved and not self._is_modified: + if self.saved and not self.modified: return args = [self['uuid'], 'modify'] if self.saved else ['add'] -- 2.39.5