def pm_reply_thread(cls): author = MotssUser.objects.all()[1] thread = Thread.objects.all()[2] pm = PostManager() post = pm.reply_thread(author, thread.tid, 'test feeds sending', \ 'test feeds sending @yuxinjin @nonexist @test002') return post
def create_thread(request): check_authenticate(request) subject = request.POST['title'] tags = request.POST['tags'].split() content = request.POST['content'] author = request.user pm = PostManager() pm.create_thread(author, subject, content, 1, [], tags) response_data = {} response_data['code'] = 0 return HttpResponse(json.dumps(response_data), mimetype="application/json")
def pm_get_thread_posts(cls): thread = Thread.objects.all()[0] pm = PostManager() posts = pm.get_thread_posts(thread.tid, 0, 20) return posts
def pm_create_thread(cls): author = MotssUser.objects.all()[1] pm = PostManager() thread = pm.create_thread(author,'test feeds sending with at',\ 'test feeds sending @yuxinjin @nonexist @test002', 1, [], ['tag1', 'tag4']) return thread