def savealbum(request): try: album = Album() album.album_name = request.POST['album_name'] album.album_time = datetime.datetime.now() album.save() except Exception: return render_to_response('backstage/upload/album.html', {"error": u"上传失败"}, context_instance=RequestContext(request)) return HttpResponseRedirect('/upload/album')
def savealbum(request): album = Album() album.album_name = request.POST['album_name'] album.album_time = datetime.datetime.now() album.save()