tw2.qrcode

QRCodeWidget
Creates a QRCode using client side javascript.
  • data
    • (str) data to be encoded
  • correction_level
    • (str) QRCode Correction Level. Valid options: H, Q, M, L
  • qr_type
    • (int) The type of QRCode. Valid options: 1 - 40
  • width
    • (int) The total width of the widget in pixels
class DemoQrcode(widgets.QRCodeWidget):
    # Provide default parameters, value, etc... here
    # default = <some-default-value>
    id = "demoqr"
    qr_type = 9
    data = "Test text qrcode. This has a lot of data in it."
    width = 300
<%namespace name="tw" module="tw2.core.mako_util"/>
<div ${tw.attrs(attrs=w.attrs)} class="qr-code" style="width:${w._width}; height:${w._width};"></div>