def get_template(template):
    if isinstance(template, MessageTemplate):
        return template
    if type(template) in [str, unicode, ObjectId]:
        return MessageTemplate.objects(pk=str(template)).first()
    else:
        return None
def template_edit(type='email', id=None):
    return render_template(
        'message_templates/edit.html',
        template=MessageTemplate.objects(pk=str(id)).first(),
        type=type)
def templates(type='email'):
    return render_template('message_templates/list.html',
                           templates=MessageTemplate.objects(type=type).all(),
                           type=type)
示例#4
0
def templates(type='email'):
    return render_template('message_templates/list.html', templates=MessageTemplate.objects(type=type).all(), type=type)
示例#5
0
def template_view(type='email', id=None):
   return render_template('message_templates/view.html', template=MessageTemplate.objects(pk=str(id)).first(), type=type)