def __init__(self, request, basket_name="basket"): super(BaseBasket, self).__init__(request.shop) self.basket_name = basket_name self.request = request if request: self.ip_address = request.META.get("REMOTE_ADDR") self.storage = get_storage() self._data = None self.dirty = False self.customer = getattr(request, "customer", None) self.orderer = getattr(request, "person", None) self.creator = getattr(request, "user", None)
def __init__(self, request, basket_name="basket"): super(BaseBasket, self).__init__(request.shop) self.basket_name = basket_name self.request = request if request: self.ip_address = request.META.get("REMOTE_ADDR") self.storage = get_storage() self._data = None self.customer = getattr(request, "customer", None) self.orderer = getattr(request, "person", None) self.creator = getattr(request, "user", None) # Note: Being "dirty" means "not saved". It's independent of # the caching status (which is cleared with self.uncache()). # I.e. it's possible to be not saved but cached, or saved but # not cached. self.dirty = False self.uncache() # Set empty values for cache variables