Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/l/f/lfs-HEAD/cart/views.py   lfs(Download)
    # Add product to cart
    try:
        cart_item = CartItem.objects.get(cart=cart, product=product)
    except ObjectDoesNotExist:
        cart_item = CartItem.objects.create(
 
    try:
        cart_item = CartItem.objects.get(cart = cart, product = product)
    except ObjectDoesNotExist:
        cart_item = CartItem(cart=cart, product=product, amount=quantity)
 
            try:
                cart_item = CartItem.objects.get(cart = cart, product = accessory)
            except ObjectDoesNotExist:
                cart_item = CartItem(cart=cart, product = accessory, amount=quantity)

src/l/f/lfs-HEAD/cart/utils.py   lfs(Download)
            for session_cart_item in session_cart.items():
                try:
                    user_cart_item = CartItem.objects.get(cart = user_cart, product = session_cart_item.product)
                except ObjectDoesNotExist:
                    session_cart_item.cart = user_cart