Exemple #1
0
def qr4_make(request, pk=None):
    if pk == None:
        img = make_pic(['进度总图表'], '/schedule/qr4_view')
    else:
        profess = get_object_or_404(Profess, pk=pk)
        img = make_pic(['进度专业图表', profess.name], '/schedule/mobile/chart/' + str(profess.id))
    img.save('test.png')
    try:
        with open('test.png', "rb") as f:
            return HttpResponse(f.read(), content_type="image/png")
    except Exception as e:
        raise e
Exemple #2
0
def qr1_make(request):
    img = make_pic(['进度信息'], '/schedule/qr1')
    img.save('test.png')
    try:
        with open('test.png', "rb") as f:
            return HttpResponse(f.read(), content_type="image/png")
    except Exception as e:
        raise e
Exemple #3
0
 def gen_qrcode_img(self):
     qr = make_pic(['技术信息', self.name], '/technology/qr2/' + str(self.id))
     qr.save(os.path.join(QR_DIR_2, QR_2_NAME_TEM % self.id), quality=100)
Exemple #4
0
 def gen_qrcode_img(self):
     qr = make_pic([
         '专业名称:' + str(self.profess), '文件类型:' +
         self.file_type_choiced[self.file_type][1], '文件标题:' + self.title
     ], '/technology/detail/' + str(self.id))
     qr.save(os.path.join(QR_DIR_3, QR_3_NAME_TEM % self.id), quality=100)
Exemple #5
0
 def gen_qrcode_img(self):
     qr = make_pic(['专业名称:'+str(self.profess), '设备名字:'+self.name], '/device/detail/' + str(self.id))
     qr.save(os.path.join(QR_DIR_3, QR_3_NAME_TEM % self.id), quality=100)
Exemple #6
0
 def gen_qrcode_img(self):
     qr = make_pic([
         '文件标题:' + self.title,
         '文件类型: ' + self.file_type_choiced[self.file_type][1]
     ], '/safety/mobile/' + str(self.id))
     qr.save(os.path.join(QR_DIR, QR_NAME_TEM % self.id), quality=100)
Exemple #7
0
 def gen_qrcode_img(self):
     qr = make_pic(['姓名:' + self.name, '部门:' + self.dept.dept_name],
                   '/member/member_detail/' + str(self.id))
     qr.save(os.path.join(QR_DIR, QR_NAME_TEM % self.member_id),
             quality=100)