Skip to content

Commit

Permalink
Make Task object store newly fabricated attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed May 7, 2014
1 parent aa637a9 commit 47d27c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion taskw/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ def __getitem__(self, key):
# This is primarily helpful for fields that *might* be
# unspecified in the JSON, but are always part of a task
# record -- like annotations.
return self._deserialize(key, None)
# Furthermore, since we're returning a value we don't really
# "have", we should stick it in the collection to be consistent
# for future queries.
value = self._deserialize(key, None)
super(Task, self).__setitem__(key, value)
return value

def __setitem__(self, key, value, force=False):
existing_value = self.get(key)
Expand Down

0 comments on commit 47d27c7

Please sign in to comment.