From 081c566aef5e34ef5aa1d6a2f6b45925778c57f6 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 7 Feb 2017 18:10:12 +1000 Subject: [PATCH] Create README.rst --- longclaw/project_template/product/README.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 longclaw/project_template/product/README.rst diff --git a/longclaw/project_template/product/README.rst b/longclaw/project_template/product/README.rst new file mode 100644 index 0000000..d1349b0 --- /dev/null +++ b/longclaw/project_template/product/README.rst @@ -0,0 +1,18 @@ +Demo project template +---------- + +1. Template Product_index.html + +Add it to your `Products\models.py`: + +.. code-block:: python + + class ProductIndex(Page): + pass + + def get_context(self, request): + # Update context to include only published products, ordered by reverse-chron + context = super(ProductIndex, self).get_context(request) + product = self.get_children().live().order_by('-first_published_at') + context['product'] = product + return context