You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have tested the package with Django 3.1.2 and Django 2.1.1.
Each time I tried, I get to see the error that library object has no attribute 'assignment_tag'.
It was mentioned that this error raises if the package is used with Django below 1.9 but it seems like it is not the case as the same error occurs with Django 2+ and 3+.
Handling this error involved modifying carton_tags.py as below but this is not permanent solution for the package. (comment out assignment_tag and register simple_tag as below)
Would there be any other way to use this package without having to see this assignment_tag error?
`
def get_cart(context, session_key=None, cart_class=Cart):
"""
Make the cart object available in template.
Sample usage::
{% load carton_tags %}
{% get_cart as cart %}
{% for product in cart.products %}
{{ product }}
{% endfor %}
request = context['request']
return cart_class(request.session, session_key=session_key)
Hi,
I have tested the package with Django 3.1.2 and Django 2.1.1.
Each time I tried, I get to see the error that library object has no attribute 'assignment_tag'.
It was mentioned that this error raises if the package is used with Django below 1.9 but it seems like it is not the case as the same error occurs with Django 2+ and 3+.
Handling this error involved modifying carton_tags.py as below but this is not permanent solution for the package. (comment out assignment_tag and register simple_tag as below)
Would there be any other way to use this package without having to see this assignment_tag error?
`
def get_cart(context, session_key=None, cart_class=Cart):
"""
Make the cart object available in template.
register.assignment_tag(takes_context=True, name=CART_TEMPLATE_TAG_NAME)(get_cart)
register.simple_tag(takes_context=True, name=CART_TEMPLATE_TAG_NAME)(get_cart)
def get_cart(context, session_key=None, cart_class=Cart):
request = context['request']
return cart_class(request.session, session_key=session_key)`
The text was updated successfully, but these errors were encountered: