def get_user_cart(user, cart_queryset=Cart.objects.all()):
 return cart_queryset.open().filter(user=user).first()

def get_user_cart ( user , cart_queryset = Cart . objects . all ( ) ) : return cart_queryset . open ( ) . filter ( user = user ) . first ( )
returns open cart for given user or none if not found .