Пример #1
0
def addsen():
    word = request.form['word']
    en = request.form['en']
    ch = request.form['ch']
    item = dict.searchWord(word)
    item['examples'].append({'sentence':en, 'translation': ch})
    return dict.modifyWord(item)
Пример #2
0
def delsen():
    word = request.form['word']
    num = request.form['num']
    n = int(num) - 1
    item = dict.searchWord(word)
    del item['examples'][n]
    return dict.modifyWord(item)
Пример #3
0
def modifysen():
    word = request.form['word']
    num = request.form['num']
    en = request.form['en']
    ch = request.form['ch']
    item = dict.searchWord(word)
    item['examples'][int(num) - 1]['sentence'] = en
    item['examples'][int(num) - 1]['translation'] = ch
    return dict.modifyWord(item)