Exemplo n.º 1
0
    def forge(category, tag, post, comment):
        """Generate fake data."""
        from bluelog.fakes import fake_admin, fake_categories, fake_tags, fake_posts, fake_comments, fake_links

        db.drop_all()
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating %d categories...' % category)
        fake_categories(category)

        click.echo('Generating %d tags...' % tag)
        fake_tags(tag)

        click.echo('Generating %d posts...' % post)
        fake_posts(post)

        click.echo('Generating %d comments...' % comment)
        fake_comments(comment)

        click.echo('Generating links...')
        fake_links()

        click.echo('Done.')
Exemplo n.º 2
0
    def forge(category, post, comment):
        '''生成虚拟数据'''
        from bluelog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links

        db.drop_all()
        db.create_all()

        click.echo('生成管理员...')
        fake_admin()

        click.echo(f'生成 {category} 个分类...')
        fake_categories(category)

        click.echo(f'生成 {post} 篇文章...')
        fake_posts(post)

        click.echo(f'生成 {comment} 条评论...')
        fake_comments(comment)

        click.echo('生成链接...')
        fake_links()

        if not os.path.exists(config['base'].CKEDITOR_UPLOAD_PATH):
            click.echo('图像上传路径不存在,创建中...')
            os.mkdir(config['base'].CKEDITOR_UPLOAD_PATH)

        click.echo('完成')
Exemplo n.º 3
0
    def forge(category, post, comment):
        """Generate fake data."""
        from bluelog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links

        click.echo('dropping old database...')
        db.drop_all()
        click.echo('creating new database...')
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating %d categories...' % category)
        fake_categories(category)

        click.echo('Generating %d posts...' % post)
        fake_posts(post)

        click.echo('Generating %d comments...' % comment)
        fake_comments(comment)

        click.echo('Generating links...')
        fake_links()

        click.echo('Done.')
Exemplo n.º 4
0
    def forge(category, post, comment, channel, website):
        """Generate fake data."""
        from bluelog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links, fake_channels, fake_websites

        db.drop_all()
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating %d categories...' % category)
        fake_categories(category)

        click.echo('Generating %d posts...' % post)
        fake_posts(post)

        #lsc
        click.echo('Generating %d channels...' % channel)
        fake_channels(channel)
        #lsc
        click.echo('Generating %d websites...' % website)
        fake_websites(website)

        click.echo('Generating %d comments...' % comment)
        fake_comments(comment)

        click.echo('Generating links...')
        fake_links()

        click.echo('Done.')
Exemplo n.º 5
0
    def forge(category, post, comment):
        """Generates the fake categories, posts and comments"""
        db.drop_all()
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating %d categories...' % category)
        fake_categories(category)

        click.echo('Generating %d posts...' % post)
        fake_posts(post)

        click.echo('Generating %d comments...' % comment)
        fake_comments(comment)

        click.echo('Generating links...')
        fake_links()

        click.echo('Done!')
Exemplo n.º 6
0
    def forge_new(category, post, comment):

        db.drop_all()
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating %d categories...' % category)
        fake_categories()

        click.echo('Generating %d posts...' % post)
        fake_posts()

        click.echo('Generating %d comments...' % comment)
        fake_comments()

        click.echo('Generating links...')
        fake_links()

        click.echo('Done.')
Exemplo n.º 7
0
    def forge(category, post, comment):
        """Generates the fake categories, post, and comments"""
        from bluelog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links

        db.drop_all()
        db.create_all()

        click.echo('Generating the administrator...')
        fake_admin()

        click.echo('Generating {} categories...'.format(category))
        fake_categories()

        click.echo('Generating {} posts...'.format(post))
        fake_posts()

        click.echo('Generating {} comments...'.format(comment))
        fake_comments()

        click.echo('Generating links...')
        fake_links()

        click.echo('Done.')
Exemplo n.º 8
0
    def forge(category, post, comment):
        """构造虚拟数据"""
        from bluelog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links

        db.drop_all()
        db.create_all()

        click.echo('生成管理员...')
        fake_admin()

        click.echo('生成 %d 分类...' % category)
        fake_categories(category)

        click.echo('生成 %d 文章...' % post)
        fake_posts(post)

        click.echo('生成 %d 评论...' % comment)
        fake_comments(comment)

        click.echo('生成链接...')
        fake_links()

        click.echo('构造完成...')