コード例 #1
0
def create_campaigns():
    data = {'status': True}
    campaign_name = request.json.get('campaign_name')
    campaign_id = request.json.get('campaign_id')

    with Campaign() as _campaign:
        _campaign.add(campaign_id, campaign_name)

    return jsonify(data)
コード例 #2
0
def update_campaign_status():
    data = {'status': True}

    campaign_id = request.json.get('campaign_id')
    status = request.json.get('status')

    with Campaign() as _campaign:
        _campaign.update_status(campaign_id, status)

    return jsonify(data)
コード例 #3
0
def campaigns():
    data = {'status': True}
    with Campaign() as campaign:
        data['campaigns'] = campaign.get_all()

    return jsonify(data)
コード例 #4
0
 def __set_campaign_id(self):
     with Campaign() as campaign:
         camp = campaign.get_campaign_by_list(self.list_id)
         self.campaign_id = camp.get('campaign_id') if camp else 0