def api_store(): sms_strings = request.get_data() path = random_string(8) ids = Alert.column('id', where='path=%s', params=[path]) if ids: Alert.update_dict({'content': sms_strings}, where='id=%s', params=[ids[0]]) else: Alert.insert({'path': path, 'content': sms_strings}) return path
def api_home(path): vs = Alert.select_vs(where='path=%s', params=[path]) sms_strings = [] if vs: sms_strings = vs[0].content.split(',,') return render_template('index.html', **locals())