示例#1
0
def feature_request_add():
    data = request.data
    data_dict = json.loads(data)
    feature_requests_dict = {}
    feature_request = FeatureRequest(test=test_mode)
    feature_request.title = data_dict['title']
    feature_request.description = data_dict['description']
    feature_request.client_name = data_dict['client_name']
    feature_request.client_priority = data_dict['client_priority']
    feature_request.target_date = data_dict['target_date']
    feature_request.product_area = data_dict['product_area']
    feature_request.agent_name = data_dict['agent_name']
    feature_request.save()
    return jsonify({
        'status': 'success',
        'message': 'Feature request added',
        'feature_request': feature_request.to_dict()
    })
示例#2
0
def feature_request_add():
    data = request.data
    data_dict = json.loads(data)
    feature_requests_dict = {}
    feature_request = FeatureRequest(test=test_mode)
    feature_request.title = data_dict['title']
    feature_request.description = data_dict['description']
    feature_request.client_name = data_dict['client_name']
    feature_request.client_priority = data_dict['client_priority']
    feature_request.target_date = data_dict['target_date']
    feature_request.product_area = data_dict['product_area']
    feature_request.agent_name = data_dict['agent_name']
    feature_request.save()
    return jsonify({
        'status': 'success',
        'message': 'Feature request added',
        'feature_request': feature_request.to_dict()
    })
示例#3
0
def feature_requests_update(feature_request_id):
    try:
        data = request.data
        data_dict = json.loads(data)
        feature_requests_dict = {}
        feature_request = FeatureRequest(test=test_mode)
        feature_request.find_by_id(feature_request_id)
        try:
            feature_request.title = data_dict['title']
        except KeyError:
            pass
        try:
            feature_request.description = data_dict['description']
        except KeyError:
            pass
        try:
            feature_request.client_name = data_dict['client_name']
        except KeyError:
            pass
        try:
            feature_request.client_priority = data_dict['client_priority']
        except KeyError:
            pass
        try:
            feature_request.target_date = data_dict['target_date']
        except KeyError:
            pass
        try:
            feature_request.product_area = data_dict['product_area']
        except KeyError:
            pass
        try:
            feature_request.agent_name = data_dict['agent_name']
        except KeyError:
            pass
        try:
            feature_request.is_open = data_dict['is_open']
        except KeyError:
            pass
    except Exception, e:
        return e
示例#4
0
def feature_requests_update(feature_request_id):
    try:
        data = request.data
        data_dict = json.loads(data)
        feature_requests_dict = {}
        feature_request = FeatureRequest(test=test_mode)
        feature_request.find_by_id(feature_request_id)
        try:
            feature_request.title = data_dict['title']
        except KeyError:
            pass
        try:
            feature_request.description = data_dict['description']
        except KeyError:
            pass
        try:
            feature_request.client_name = data_dict['client_name']
        except KeyError:
            pass
        try:
            feature_request.client_priority = data_dict['client_priority']
        except KeyError:
            pass
        try:
            feature_request.target_date = data_dict['target_date']
        except KeyError:
            pass
        try:
            feature_request.product_area = data_dict['product_area']
        except KeyError:
            pass
        try:
            feature_request.agent_name = data_dict['agent_name']
        except KeyError:
            pass
        try:
            feature_request.is_open = data_dict['is_open']
        except KeyError:
            pass
    except Exception, e:
        return e