Created
January 27, 2014 10:03
-
-
Save svschannak/8646029 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def product_list(self): | |
products = self.products.all() | |
product_list = [] | |
for product in products: | |
for product_store in product.stores_for_product.all(): | |
product_list.append(product_store) | |
for cat in self.child_categories.all(): | |
for product in cat.product_list(): | |
product_list.append(product) | |
return product_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment