Пример #1
0
from txrestapi.resource import APIResource
from txrestapi import methods

from sqlalchemy import create_engine, select, outerjoin, and_

from autobahn.twisted.util import sleep
from autobahn.wamp import auth
from autobahn.twisted.wamp import ApplicationSession
from autobahn.wamp.exception import ApplicationError
from authsys_common.model import meta, members, entries, tokens, vouchers, covid_indemnity, transactions, failed_checks
from authsys_common import queries as q
from authsys_common.scripts import get_db_url, get_config
from authsys_common.mandate import create_mandate

eng = create_engine(get_db_url())
con = eng.connect()
meta.reflect(bind=eng)


class VoucherManager(APIResource):
    def __init__(self, arg):
        APIResource.__init__(self)

    @methods.POST('^/voucher/new$')
    def voucher_gen(self, request):
        MAX_X = 210
        MAX_Y = 297

        f = FPDF('P', 'mm', 'A4')
        f.add_page()
Пример #2
0
#!/usr/bin/env python

from authsys_common.scripts import create_db, get_db_url

create_db(get_db_url())