Esempio n. 1
0
def create_temp_posts():
  with open('fixtures/posts.json') as f:
    posts = json.load(f)
    for p in posts:
      t = Thread.select().where(Thread.id==p['thread']).get()
      u = Profile.select().where(Profile.id==p['author']).get()
      Post.create(author=u, thread=t, body=p['body'], is_sticky=[['is_sticky']])