X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/1e2987ad784dbb5145fc4de35018c2cdb6cc6cd5..d409220d5abb52c0bb0022bf8b24728636a96a5b:/tasklib/task.py?ds=sidebyside diff --git a/tasklib/task.py b/tasklib/task.py index 64c13ac..d9b2678 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -92,7 +92,7 @@ class TaskAnnotation(TaskResource): class Task(TaskResource): - read_only_fields = ['id', 'entry', 'urgency', 'uuid'] + read_only_fields = ['id', 'entry', 'urgency', 'uuid', 'modified'] class DoesNotExist(Exception): pass @@ -130,6 +130,7 @@ class Task(TaskResource): # We keep data for backwards compatibility # TODO: Should we keep this using unserialized access to _data dict? self._data.update(data) + self._original_data.update(data) def __unicode__(self): return self['description'] @@ -153,7 +154,8 @@ class Task(TaskResource): @property def _modified_fields(self): - for key in self._data.keys(): + writable_fields = set(self._data.keys()) - set(self.read_only_fields) + for key in writable_fields: if self._data.get(key) != self._original_data.get(key): yield key