Beispiel #1
0
def set_post(post,form):
    post.title=form.title.data
    if(post.url==None or post.url==''):
        post.url=post.slugify(post.title)
    else:
        post.url=post.slugify(post.url)
    post.description=form.description.data
    post.content=form.content.data
    post.post_type=form.post_type.data
    post.post_status=form.post_status.data
    post.author=User.get_by_id(session['user_id'])
    post.category=Category(name=form.category.data)
    my_tags = []
    for tag in form.tags.data.lower().split(','):
        my_tags.append(Tag(name=tag))
    post.tags=my_tags

    return post
Beispiel #2
0
def tag_pastor():
    tag = Tag(name='pastor')
    tag.put()
    return tag
Beispiel #3
0
def tag_event():
    tag = Tag(name='event')
    tag.put()
    return tag
Beispiel #4
0
def tag_computer():
    tag = Tag(name='computer')
    tag.put()
    return tag
Beispiel #5
0
def find_by_tag_name(tag):
    posts = Post.query(Post.tags == Tag(name=tag),
                       Post.post_status != 'draft').fetch()
    return render_template("site/post_list.html", posts=posts)
Beispiel #6
0
def tag_pastor():
  tag = Tag(name='pastor')
  tag.put()
  return tag
Beispiel #7
0
def tag_event():
  tag = Tag(name='event')
  tag.put()
  return tag
Beispiel #8
0
def tag_computer():
  tag = Tag(name='computer')
  tag.put()
  return tag