示例#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 del_comment(key, content):
  comment = Content.get(key, bucket="spm_comments")
  comment.delete()
示例#3
0
文件: __init__.py 项目: Ardroid/spm
def edit_comment(key, content):
  comment = Content.get(key, bucket="spm_comments")
  comment.title = content["title"]
  comment.content = content["content"]
  comment.save(bucket="spm_comments")
  return comment
示例#4
0
文件: __init__.py 项目: Ardroid/spm
def del_update(key):
  update = Content.get(key, bucket="spm_posts")
  for comment in update.comments:
    comment.delete()

  update.delete()
示例#5
0
文件: __init__.py 项目: Ardroid/spm
def edit_update(key, content):
  update = Content.get(key, bucket="spm_posts")
  update.title = content["title"]
  update.content = content["content"]
  update.save(bucket="spm_posts")
  return update
示例#6
0
文件: projects.py 项目: shuhaowu/spm
def get_wall_post(key):
  return Content.get(key, bucket="spm_wallposts")