Python jinja2.utils 模块,generate_lorem_ipsum() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用jinja2.utils.generate_lorem_ipsum()

项目:radar    作者:renalreg    | 项目源码 | 文件源码
def create_posts(n):
    for x in range(n):
        d = random_date(date(2008, 1, 1), date.today() - timedelta(days=1))

        post = Post()
        post.title = '%s Newsletter' % d.strftime('%b %Y')
        post.body = generate_lorem_ipsum(n=3, html=False)
        post.published_date = d
        add(post)

    post = Post()
    post.title = 'New RaDaR Conditions'
    post.body = 'RaDaR is now open to two new conditions - Calciphylaxis and IgA Nephropathy. '\
        'No new approvals are needed for these conditions and patients are registered in the normal fashion.'
    post.published_date = date.today()
    add(post)