Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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())
Beispiel #4
0
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())