def address_creator(num_addr):
LIST_COUNTRIES = ['Belgium', 'France', 'Germany',
'Greece', 'Italy', 'Portugal', 'Spain']
for i in range(num_addr):
country = random.choice(LIST_COUNTRIES)
Address.create(
uuid=fake.uuid4(),
user=User.select().order_by(fn.Random()).get(),
country=country,
city=fake.city(),
post_code=fake.postcode(),
address=fake.street_name(),
phone=fake.phone_number(),
)
评论列表
文章目录