예제 #1
0
파일: __init__.py 프로젝트: Ardroid/spm
def add_comment(key, author, content):
  comment = Content(title=content["title"], content=content["content"], author=author)
  update = Content.get(key, bucket="spm_posts")
  update.comments.append(comment)
  comment.save(bucket="spm_comments")
  update.save(bucket="spm_posts")
  return comment
예제 #2
0
파일: __init__.py 프로젝트: Ardroid/spm
def post_update(author, content):
  update = Content(title=content["title"], content=content["content"], author=author)
  update.save(bucket="spm_posts")
  return update
예제 #3
0
파일: projects.py 프로젝트: shuhaowu/spm
def add_wall_post(key, content, user):
  post = Content(title=content, author=user)
  post.addIndex("project_bin", key)
  post.save(bucket="spm_wallposts")
  return post