Skip to content

Instantly share code, notes, and snippets.

@svschannak
Created January 27, 2014 10:03
Show Gist options
  • Save svschannak/8646029 to your computer and use it in GitHub Desktop.
Save svschannak/8646029 to your computer and use it in GitHub Desktop.
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