Created
June 14, 2017 08:19
-
-
Save infinite-Joy/1aaade7f2f7c07c818c0917e5404277b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myFactory = Faker() | |
Session = sessionmaker(bind=mysql_engine) | |
session = Session() | |
billing_type_list = ['cheque', 'cash', 'credit', 'debit', 'e-wallet'] | |
language = ['English', 'Bengali', 'Kannada'] | |
operating_system = 'linux' | |
for i in range(60000, 1000000): | |
transaction = Transactions( | |
id = int(i), | |
name = myFactory.name(), | |
description = myFactory.text(), | |
country_name = myFactory.country(), | |
city_name = myFactory.city(), | |
cost = str(myFactory.random_digit_not_null()), | |
currency = myFactory.currency_code(), | |
created_at = myFactory.date_time_between(start_date="-30y", end_date="now", tzinfo=None), | |
billing_type = random.choice(billing_type_list), | |
language = random.choice(language), | |
operating_system = operating_system | |
) | |
session.add(transaction) | |
session.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment