コード例 #1
0
def delete_user(user_id):
    """
    Delete user specified in user ID
    Note: Always return the appropriate response for the action requested.
    """
    if Users.objects(Id=user_id).delete() != 0:
        return "User deleted successfully"
    else:
        return make_response(jsonify({'error': 'User not found'}), 404)
コード例 #2
0
def get_users():
    """
    Update this to return a json stream defining a listing of the users
    Note: Always return the appropriate response for the action requested.
    """
    return Users.objects().to_json()