Пример #1
0
def write_step1():
    if request.method == 'POST':
        w_dict = dict()
        w_dict['updated'] = konata.now_time()
        w_dict['title'] = request.form['title']
        w_dict['context'] = request.form['context']
        w_dict['author'] = 'name'

        json_data = json.dumps([w_dict])
        up_data[w_dict['updated']] = json_data

        w_dict['markdown'] = md2html(w_dict['context'])
        w_dict['published'] = '2038-01-19 03:14:07'
        return render_template('write1.html.ja', root=w_dict)

    return redirect(url_for('write'), code=302)
Пример #2
0
 def test_now_time(self):
     self.assertEqual(konata.now_time(), '2016-06-18 18:47:05')