예제 #1
0
def systemmessage():
    form = MessageForm()
    if form.validate_on_submit():
        message = {'username': '******', 'text': form.message.data}
        redis.publish('chat', json.dumps(message))
        flash('System message send success', 'success')
    return redirect(url_for('admin.message'))
예제 #2
0
def message():
    form = MessageForm()
    if form.validate_on_submit():
        message = form.create_message()
        flash('系统消息发送成功', 'success')
        return redirect(url_for('live.systemmessage', message=message))
    return render_template('admin/message.html', form=form)
예제 #3
0
파일: admin.py 프로젝트: leoyield/Louplus
def send_message():
    form = MessageForm()
    if form.validate_on_submit():
        form.send_message()
        flash('消息发送成功', 'success')
        return redirect(url_for('admin.send_message'))
    return render_template('admin/send_message.html', form=form)
예제 #4
0
def systemmessage():
    form = MessageForm()
    if form.validate_on_submit():
        my_redis.publish(
            'chat', json.dumps(dict(username='******', text=form.text.data)))
        flash('系统消息发送成功', 'success')
        return redirect(url_for('admin.message'))
예제 #5
0
def systemmessage():
    form = MessageForm()
    if form.validate_on_submit():
        redis.publish('chat',
                      json.dumps(dict(username='******', text=form.text.data)))
        flash('系统消息发送成功', 'success')
        return redirect(url_for('live.systemmessage'))
    return render_template('admin/message.html', form=form)
예제 #6
0
def send_message():
    form = MessageForm()
    if form.validate_on_submit():
        redis.publish('chat', json.dumps(dict(
            username='******',
            text=form.text.data
        )))
        flash('系统消息发送成功', 'success')
        return redirect(url_for('admin.index'))
    return render_template('admin/message.html', form=form)
예제 #7
0
def send_message():
    form = MessageForm()
    if form.validate_on_submit():
        redis.publish(
            'chat', json.dumps({
                'username': '******',
                'text': form.text.data
            }))
        flash('Message sended successly.', 'success')
        return redirect(url_for('admin.index'))
    return render_template('admin/message.html', form=form)
예제 #8
0
def message():
	form = MessageForm()
	if form.validate_on_submit():
		redis.publish(
		    'chat',
		    json.dumps(dict(
		    username='******',
		    text=str(form.msg.data)
		    )))
		flash('Send Message,OK!')
	return render_template('admin/sys_msg.html',form=form)
예제 #9
0
def message():
    form = MessageForm()
    return render_template('admin/message.html', form=form)