Hi,
I had this problem as well. It is related, as you probably realised, to the
sale key which is not part of your Request Context. I found a solution but
it is at the moment very inefficient. Maybe, someone else can help with
something better.
Here is what I have done:
*******************************************************************
from product.utils import find_best_auto_discount
def shop(request, template="shop/shop_base.html"):
[...]
Prod = Product.objects.all()
[...]
best_discount = find_best_auto_discount(list(Prod))
myDict = {
'all_products_list' : page.object_list,
'is_paginated' : is_paged,
'page_obj' : page,
'paginator' : paginator,
'sale' : best_discount,
}
ctx=RequestContext(request, myDict)
return render_to_response(template, context_instance=ctx)
*******************************************************************
Hope this helps.
Regards,
Olivier
Le 27 mars 2012 22:10, easypie <[email protected]> a écrit :
> sure. here's the error: dpaste.com/722438/
>
>
> On Tuesday, March 27, 2012 1:52:30 PM UTC-7, olauret wrote:
>>
>> Can you share with us the error message?
>>
>> This might give us a hint.
>> On Mar 27, 2012 9:27 PM, "easypie" <[email protected]> wrote:
>>
>>> Why does {{ product|discount_price:sale|**currency }} return an error
>>> in shop/index.html template? I wanted the product thumbnail to also include
>>> the price listed below it. But there is an error?
>>>
>>> here's a link to the template: dpaste.com/722410
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Satchmo users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/satchmo-users/-/**E29WNHCJgxYJ<https://groups.google.com/d/msg/satchmo-users/-/E29WNHCJgxYJ>
>>> .
>>> To post to this group, send email to [email protected]**.
>>> To unsubscribe from this group, send email to satchmo-users+unsubscribe@
>>> **googlegroups.com <satchmo-users%[email protected]>.
>>> For more options, visit this group at http://groups.google.com/**
>>> group/satchmo-users?hl=en<http://groups.google.com/group/satchmo-users?hl=en>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/satchmo-users/-/uVJa8t2TGtEJ.
>
> 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.
>
--
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.