Пример #1
0
def delete(cart_item_id):
    _ensure_cart_item_is_not_ordered(cart_item_id)
    return database_service.delete_entity_instance(CartItem, cart_item_id,
                                                   False)
def delete(cart_id):
    cart = get(cart_id)
    if cart['is_ordered']:
        return f'Bad Request: You cannot delete cart with id "{cart_id}" that has an associated order.', 400

    return database_service.delete_entity_instance(Cart, cart_id)
Пример #3
0
def delete(event_id):
    return database_service.delete_entity_instance(Event, event_id)
def delete(user_id):
    return database_service.delete_entity_instance(User, user_id)
Пример #5
0
def delete(product_id):
    return database_service.delete_entity_instance(Product, product_id)