def get_or_create_user_cart(user, cart_queryset=Cart.objects.all()):
 return cart_queryset.open().get_or_create(user=user)[0]

def get_or_create_user_cart ( user , cart_queryset = Cart . objects . all ( ) ) : return cart_queryset . open ( ) . get_or_create ( user = user ) [ 0 ]
returns open cart for given user or creates one .