views.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:habilitacion 作者: GabrielBD 项目源码 文件源码
def pdfPG(request, nrop):

  if not request.session['nropreinscripto'] == nrop:
    return HttpResponse("ERROR AL GENERAR EL COMPROBANTE")

  template = get_template('pg/pg/comprobante.html')

  postulante  = Postulante.objects.get(pg__nro_de_preinscripto=nrop)

  contexto = {'postulante' : postulante }
  pdf = render_to_pdf('pg/pg/comprobante.html', contexto)

  if pdf:
    response = HttpResponse(pdf, content_type='application/pdf')
    filename = "Comprobante_Preinscripcion"
    content = "inline; filename='%s'" % (filename)
    return response

  return HttpResponse("ERROR AL GENERAR EL COMPROBANTE")

####


#listado de todas las preinscripciones
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号