Quick and dirty patch for getting transactions from a category
Closed this issue · 1 comments
rob-carruthers commented
Hi, didn't think it was worth branching just for this. Very quick patch for another bit of functionality, just made it by poking around. See what you think. The methods of Transaction work too. Thanks
diff --git a/ynab/models.py b/ynab/models.py
index 1e0b3b4..4f9bf53 100644
--- a/ynab/models.py
+++ b/ynab/models.py
@@ -182,6 +182,10 @@ class Category(CategoryModel):
def full_name(self):
return '{}/{}'.format(self.master_category.name, self.name)
+ @property
+ def transactions(self):
+ return self._ynab.transactions.filter('category', self)
+
class MasterCategory(CategoryModel):
_entity_type = schema.MasterCategory