def clone(request, id): try: object = dao.get(id) except : raise Http404 key = dao.save_clone(object, request.user) request.user.message_set.create(message='\"' + object.what + '\" 已经添加到您的名下!'.decode('utf-8')) return HttpResponseRedirect('/wantown/view/id/' + id)
def view(request, id): try: object = dao.get(id) except : raise Http404 return render_to_response('view.html', {'object':object}, context_instance=RequestContext(request))