def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['permission_view'] = self.request.user.has_perm('order.view_order') context['permission_delete'] = self.request.user.has_perm('order.delete_order') context['permission_change'] = self.request.user.has_perm('order.change_order') context['search_field'] = 'order:order-list' book_utils.edit_context(self.request, context) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) book_utils.edit_context(self.request, context) obj_cart = utils.get_create_current_cart(self) context['book_list'] = obj_cart.booksincart.all().order_by( self.get_ordering()) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) book_utils.edit_context(self.request, context) current_order_id = self.request.session.get('current_order_pk') if current_order_id: obj_cart = models.Order.objects.filter(pk=current_order_id).first().cart else: obj_cart = cart_utils.get_create_current_cart(self) context['book_list'] = obj_cart.booksincart.all().order_by(self.get_ordering()) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) user_customer = self.request.user context['permission_edit'] = self.request.user.has_perm( 'order.change_order') context['permission_delete'] = self.request.user.has_perm( 'order.delete_order') context['userprofile_order_list'] = order_models.Order.objects.filter( cart__customer=user_customer).all() book_utils.edit_context(self.request, context) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['permission'] = self.request.user.has_perm( 'order.delete_order') context = book_utils.edit_context(self.request, context) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['permission'] = self.request.user.has_perm( 'customer.change_userprofile') context = book_utils.edit_context(self.request, context) return context
def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context = book_utils.edit_context(self.request, context) return context