Hi Torimus,
you could create custom view or add all_products to context:
def all_products(request):
#pagination here
context = { 'all_products': Product.objects.all(), }
return render_to_response('all_products.html', context)
take a look here for help with Django pagination:
https://docs.djangoproject.com/en/dev/topics/pagination/
if you want access all_products in many templates you could create custom
context processor:
https://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors
Cheers,
Arek
On Wed, Jul 24, 2013 at 3:53 PM, Torimus Caos <[email protected]> wrote:
> Hi,
>
> as a relative newcomer to Satchmo, I'm looking for a solution how to
> display all products paginated, in any template.
>
> I've written following custom templatetag, but dunno if it's necessary:
>
> from django import template
> from product.models import Product
>
> register = template.Library()
>
> @register.assignment_tag
> def all_products():
> return Product.objects.all().order_by('name')
>
> I'd like to display all products like it's done in product/category.html
> template, but even if I do load satchmo_category templatetags in my custom
> template, `products' tag is empty (missing context ?).
>
> Any advice is appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/satchmo-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/satchmo-users.
For more options, visit https://groups.google.com/groups/opt_out.