예제 #1
0
def postEntry(request):
    """Accepts the HTTP POST data of a new blog entry and 
       updates the database accordingly"""
    b = Blog()
    b.title = request.POST["title"]
    b.reply_to = request.POST["reply_to"]
    b.content = request.POST["content"]
    b.post_date = datetime.now()
    b.save()
    return HttpResponseRedirect("/simpleblog/blog/%s/" % b.id)
예제 #2
0
def postEntry(request):
      """Accepts the HTTP POST data of a new blog entry and updates the database """
      if not(request.user.has_perm("dblog.may_create_blogs")):
          return render_to_response("blogPD.html")
      b = Blog()
      b.title = request.POST['title']
      b.reply_to = request.POST['reply_to']
      b.content = request.POST['content']
      b.post_date = datetime.datetime.now()
      b.save()
      return HttpResponseRedirect('/blog/%s/' % b.id)