Monthly Archives: October 2016

[Book]Python 201

Python 201 Advertisements

Posted in python | Leave a comment

custom form 생성하기

in order to apply attributes to a custom form you have to change form.custom.begin before. The following code should work: #view html {{extend ‘layout.html’}} {{ # add class to form form[‘_class’] = “form-horizontal” # change form.custom.begin form.custom.begin = XML(“<%s %s>” % (form.tag, form._xml()[0])) }}{{=form.custom.begin}} your content form {{=form.custom.end}} … Continue reading

Posted in python, web2py | Leave a comment

PDF파일을 첨부파일로 다운로그 하기

  pdf.output(name=request.folder+’/static/temp.pdf’)     response.headers[‘Content-Disposition’] = ‘attachment; filename=abc.pdf’# to force download as attachment # replace abc with whatever pdf name you want the user to see.     response.headers[‘Content-Type’]=’application/pdf’     return response.stream(open(request.folder+’/static/temp.pdf’,’rb’),chunk_size=4096) https://groups.google.com/d/msg/web2py/jjiLhFONd18/or2-N7Fs2DkJ

Posted in python, web2py | Leave a comment

Database에 파일 저장하는 방법

https://groups.google.com/d/msg/web2py/8AoudcgECfY/IMOcW7zovoIJ 2012-11-19 in model db.define_table(‘attachments’,         Field(‘attachment’, ‘upload’, uploadfield=’payload’),         Field(‘filename’, length=512),         Field(‘Description’, ‘text’),         Field(‘payload’, ‘blob’),         migrate=init_migrate,         ) … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

User accessed site without logging in

User accessed site without logging in 로긴한적없는 유저가 다른유저로 로긴되어 있는 현상 발생 알고봤더니 uWSGI의 async버그로 발생한 문제, uWSGI의 ipv6 address 처리 오류 forum: https://groups.google.com/d/msg/web2py/Tt8Rmp5UlCE/_p2gRxoviioJ client ipaddress의 validation추가 git: https://github.com/web2py/web2py/commit/5a16a35ef2fa759eefdd20e67d2d41103dc48b10

Posted in python, web2py | Leave a comment

web2py 2.0 rc – lazy table

https://groups.google.com/d/topic/web2py/YNfreBJ2LYo/discussion

Posted in Uncategorized | Leave a comment