lazybird / django-carton

A simple and lightweight application for shopping carts and wish lists.
Other
274 stars 101 forks source link

'Library' object has no attribute 'assignment_tag' #3

Closed ghost closed 11 years ago

ghost commented 11 years ago

carton_tags.py keep this error

thanks

lazybird commented 11 years ago

Django introduced assignment tags in version 1.4. You are getting this error: _object has no attribute 'assignmenttag'. It's probably because Django version < 1.4 is being used.

BrealX commented 6 years ago

... and again the same error, but now it's caused by deprecation and removing "assignment_tag" from Django > 1.9. I've solved it with replacing decrecated "assignment_tag" for "simple_tag" like below:

In carton_tags.py:

@register.simple_tag(takes_context=True, name=CART_TEMPLATE_TAG_NAME) def get_cart(context, session_key=None, cart_class=Cart): ----request = context['request'] ----return cart_class(request.session, session_key=session_key)

Works fine with Django 2.0.3