示例#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