on ajuste les scripts pour remplir de manière plus 'crédible'

This commit is contained in:
Jean-Marie Favreau
2023-11-06 18:16:45 +01:00
parent 604c3591d7
commit dc70973ca1
2 changed files with 14 additions and 13 deletions

View File

@@ -34,11 +34,12 @@ def run():
'tags': [tags[random.randint(0, len(tags) - 1)] for i in range(0, random.randint(0, 10))]
}
if random.randint(0, 1) == 1:
fields["end_day"] = (sday + timedelta(days=random.randint(0, 6))).date()
if random.randint(0, 1) == 1:
fields["start_time"] = random_hour()
if random.randint(0, 1) == 1:
fields["end_time"] = random_hour()
else:
if random.randint(0, 5) == 1:
fields["end_day"] = (sday + timedelta(days=random.randint(0, 6))).date()
if random.randint(0, 1) == 1:
fields["end_time"] = random_hour()
faker.create(fields)