def run(self): tokens = [ ('full_discount', 'testtoken'), ] for code, token in tokens: tt = TicketToken(token, datetime.utcnow() + timedelta(days=7)) tt.type = TicketType.query.get(code) db.session.commit() print 'Tokens added'
def run(self): tokens = [ ('full_ucl', 'ucl1'), ('full_ucl', 'ucl2'), ('full_ucl', 'ucl3'), ('full_hs', 'hs1'), ('full_hs', 'hs2'), ('full_hs', 'hs3'), ] for code, token in tokens: tt = TicketToken(token, datetime.utcnow() + timedelta(days=7)) tt.type = TicketType.query.get(code) db.session.commit() print 'Tokens added'