예제 #1
0
def create_voucher(gateway, minutes=60, code=None, quiet=True):
    voucher = Voucher()

    # Allow explicit setting of code (for tests)
    if code is not None:
        voucher.code = code

    voucher.gateway_id = gateway
    voucher.minutes = minutes

    db.session.add(voucher)
    db.session.commit()

    if not quiet:
        print 'Voucher created: %s:%s' % (voucher.id, voucher.code)
예제 #2
0
def create_voucher(gateway, minutes=60, id=None, quiet=True):
    voucher = Voucher()

    # Allow explicit setting of ID (for tests)
    if id is not None:
        voucher.id = id

    voucher.gateway_id = gateway
    voucher.minutes = minutes

    db.session.add(voucher)
    db.session.commit()

    if not quiet:
        print 'Voucher created: %s' % voucher.id
예제 #3
0
def create_voucher(gateway, minutes=60, id=None, quiet=True):
    voucher = Voucher()

    # Allow explicit setting of ID (for tests)
    if id is not None:
        voucher.id = id

    voucher.gateway_id = gateway
    voucher.minutes = minutes

    db.session.add(voucher)
    db.session.commit()

    if not quiet:
        print 'Voucher created: %s' % voucher.id