Exemplo n.º 1
0
def new():
    method = 'POST'
    action = '.'
    form = PostForm(request.form)
    if form.validate_on_submit():
        post = Post()
        post = set_post(post,form)
        print(post)
        post.put()
        flash('Post created!')
        return redirect(url_for('.index'))
    return render_template("posts/new.html", form=form, method=method, action=action)
Exemplo n.º 2
0
def post_test():
    tags = [tag_pastor(), tag_computer()]
    post = Post(title='My Test Post',
                description='My Test Description',
                content='My test content',
                post_type='post',
                post_status='published',
                author=test_user(),
                category=category_sermon(),
                tags=tags)
    post.url = post.slugify(post.title)
    post.put()
    return post
Exemplo n.º 3
0
def page_test():
    tags = [tag_event]
    page = Post(title='My Test Page',
                description='My Test Page Description',
                content='My test page content',
                post_type='page',
                post_status='publisehd',
                author=test_user,
                category=category_worship,
                tags=tags)
    page.url = page.slugify(page.title)
    page.put()
    return page
Exemplo n.º 4
0
def post_test():
    tags = [tag_pastor(), tag_computer()]
    post = Post(
        title="My Test Post",
        description="My Test Description",
        content="My test content",
        post_type="post",
        post_status="published",
        author=test_user(),
        category=category_sermon(),
        tags=tags,
    )
    post.url = post.slugify(post.title)
    post.put()
    return post
Exemplo n.º 5
0
def page_test():
    tags = [tag_event]
    page = Post(
        title="My Test Page",
        description="My Test Page Description",
        content="My test page content",
        post_type="page",
        post_status="publisehd",
        author=test_user,
        category=category_worship,
        tags=tags,
    )
    page.url = page.slugify(page.title)
    page.put()
    return page