From 0942ce26e1341c25afd3a4addbc1adea6d5530f7 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 21 Sep 2015 11:07:15 +0300 Subject: Cleanup --- requirements.pip | 2 +- servo/models/product.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements.pip b/requirements.pip index 98d4d6e..b5f06dd 100644 --- a/requirements.pip +++ b/requirements.pip @@ -1,11 +1,11 @@ django +django-mptt django-countries django-bootstrap3 djangorestframework babel markdown python-memcached -django-mptt psycopg2 pil reportlab diff --git a/servo/models/product.py b/servo/models/product.py index a92e750..5d97ae3 100644 --- a/servo/models/product.py +++ b/servo/models/product.py @@ -546,6 +546,9 @@ class ProductCategory(MPTTModel): objects = TreeManager() def get_products(self): + """ + Returns products under this entire category branch + """ return Product.objects.filter( categories__lft__gte=self.lft, categories__rght__lte=self.rght, -- cgit v1.2.3