def submitidea(request): error_msg = u"No POST data sent." if request.method == "POST": post = request.POST.copy() if post.has_key('tags') and post.has_key('title') and post.has_key('content'): try: content = post['content'] idea = Idea() idea.tags = post['tags'].strip().split(',') idea.author = str(request.user) print "user: "******"Insufficient POST data (need 'content' and 'title'!)" return HttpResponseServerError(error_msg)
def initIdeas(request): for i in range(100): idea = Idea() idea.title = "idea "+str(i) idea.content = "This is a test Idea" idea.author = "jimmy" idea.save() return HttpResponseRedirect('/')