mirumee/satchless — Issue #89: Invalid template tag
Author: sromero84
Created: 2011-12-16 19:48:45+00:00
State: open

Hello,

I'm using Satchless (commit 5a28b0ea8f924d958b3e749e341fcea261c79969) and I've found a big problem when viewing category details.

The template "satchless/category/view.html" (https://github.com/mirumee/satchless/blob/master/satchless/category/templates/satchless/category/view.html) template uses the custom filter "product_in_category_url" (https://github.com/mirumee/satchless/blob/master/satchless/product/templatetags/product_url.py#L5) to link products to the details page.

However, the model method (https://github.com/mirumee/satchless/blob/master/satchless/product/models.py#L32) receives no argument named "category", so you get an error.

If you try to simply use {{ product.get_absolute_url }}, you get the empty string "", so no linkage is done either. Finally if you try to use the {% url %} template tag to get the url using the namespace, like:

{% url 'products:details' product.pk product.slug %}

... you get an "Caught NoReverseMatch while rendering: u'products' is not a registered namespace".

My categories.app simply contains:

import satchless.category.app

from . import models
import products.models

class CategoryApp(satchless.category.app.CategorizedProductApp):
Category = models.Category
Product = products.models.Product
Variant = products.models.Variant

product_app = CategoryApp()

Where Category, Product and Variant are models defined by me extending satchless.category.models.Category, satchless.product.models.Product and satchless.product.models.Variant, respectively.

Any help with this issue will be appreciated.

Thanks for your hardwork,
Santiago.