Esempio n. 1
0
def get_client_detail( client_id ):
    client = Client.query.get( client_id )
    if client is None:
        return create_error_response( 404, 'Client does not exist' )
    response = {
        'client' : client.serialize()
    }
    return jsonify( response )
Esempio n. 2
0
def delete_client( client_id ):
    client = Client.query.get( client_id )
    if client is None:
        return create_error_response( 404, 'Client does not exist' )
    client.delete()
    response = {
        'msg' : 'Client %r successfully deleted' % client.id
    }
    return jsonify( response )