# Path: cmsplugin_shop/models.py
# class Cart(models.Model):
#     last_updated = models.DateTimeField(_('last updated'), auto_now=True)
# 
#     class Meta:
#         verbose_name        = _('cart')
#         verbose_name_plural = _('carts')
# 
#     def __str__(self):
#         return ', '.join(map(smart_text, self.all_items))
# 
#     def get_absolute_url(self):
#         return reverse('Cart:cart')
# 
#     @cached_property
#     def all_items(self):
#         return list(self.items.order_by('product__name', 'package__multiple'))
# 
#     def get_price(self):
#         if len(self.all_items):
#             return sum(item.get_price() for item in self.all_items)
#         else:
#             return Price(0)
#     get_price.short_description = _('price')


import datetime
from django.utils import timezone
from django.utils.functional import cached_property
from . import settings
from .models import Cart
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement





def cart(self):
    try:

# Path: cmsplugin_shop/models.py
# class Cart(models.Model):
#     last_updated = models.DateTimeField(_('last updated'), auto_now=True)
# 
#     class Meta:
#         verbose_name        = _('cart')
#         verbose_name_plural = _('carts')
# 
#     def __str__(self):
#         return ', '.join(map(smart_text, self.all_items))
# 
#     def get_absolute_url(self):
#         return reverse('Cart:cart')
# 
#     @cached_property
#     def all_items(self):
#         return list(self.items.order_by('product__name', 'package__multiple'))
# 
#     def get_price(self):
#         if len(self.all_items):
#             return sum(item.get_price() for item in self.all_items)
#         else:
#             return Price(0)
#     get_price.short_description = _('price')


# Path: cmsplugin_shop/middleware.py
import datetime
from django.utils import timezone
from django.utils.functional import cached_property
from . import settings
from .models import Cart

from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement





def cart(self):
    try:

        c = Cart.objects.get(id=self.session[settings.SESSION_KEY_CART], order=None)