wagtail-longclaw/longclaw/project_template/product
Alex 0ae583f453 Create product.html 2017-02-07 18:26:44 +10:00
..
README.rst Update README.rst 2017-02-07 18:10:46 +10:00
product.html Create product.html 2017-02-07 18:26:44 +10:00
product_index.html Add project_template 2017-02-07 18:00:39 +10:00

README.rst

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