Hi everyone, thank you for the tips, i'm beginning to understand.. I've got pagination working for parent categories that have no child categories.
http://vipautographs.com/autographs/album-flats/ - shows a page with pagination (5 products per page) http://vipautographs.com/autographs/ - shows a page with thousands of products grouped by category, with no pagination http://vipautographs.com/autographs/guitars/ - shows a page with hundreds of guitars under their child categories, with no pagination How do you folks handle a page like /autographs/ and /guitars/ ... ? This is what i've got so far: def category_view(request, slug, parent_slugs='', template='product/ category.html'): try: category = Category.objects.get_by_site(slug=slug) product_list = list(category.active_products()) sale = find_best_auto_discount(product_list) except Category.DoesNotExist: return bad_or_missing(request, _('The category you have requested does not exist.')) paginator = Paginator(product_list, 5) try: page = int(request.GET.get('page', '1')) except ValueError: page = 1 try: products = paginator.page(page) except (EmptyPage, InvalidPage): products = paginator.page(paginator.num_pages) child_categories = category.get_all_children() ctx = { 'category': category, 'child_categories': child_categories, 'sale' : sale, 'products' : products, } index_prerender.send(Product, request=request, context=ctx, category=category, object_list=products) return render_to_response(template, RequestContext(request, ctx)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
