Subversion Repositories SmartDukaan

Rev

Rev 6922 | Rev 7746 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6922 Rev 7092
Line 271... Line 271...
271
 
271
 
272
def delete_coupon(coupon_code):
272
def delete_coupon(coupon_code):
273
    Coupon.query.filter_by(coupon_code = coupon_code).delete()
273
    Coupon.query.filter_by(coupon_code = coupon_code).delete()
274
    session.commit()
274
    session.commit()
275
 
275
 
-
 
276
def get_all_coupons_by_promotion_id(promotion_id):
-
 
277
    all_coupons = Coupon.query.filter_by(promotion_id = promotion_id).all()
-
 
278
    return [to_t_coupon(coupon) for coupon in all_coupons]
-
 
279
    
-
 
280
    
-
 
281
 
276
def add_voucher(t_voucher):
282
def add_voucher(t_voucher):
277
    voucher = RechargeVoucher()
283
    voucher = RechargeVoucher()
278
    voucher.available = True
284
    voucher.available = True
279
    voucher.amount = t_voucher.amount
285
    voucher.amount = t_voucher.amount
280
    voucher.voucherCode = t_voucher.voucherCode
286
    voucher.voucherCode = t_voucher.voucherCode