-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (40 loc) · 1.01 KB
/
main.py
File metadata and controls
46 lines (40 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from models import User, Event
from services import enroll_user
from datetime import datetime, timedelta
from random import randint
from zoneinfo import ZoneInfo
from collections import defaultdict
events = []
for x in range(0, 50):
title = f'event_{x}'
day = randint(4, 30)
starts_at = datetime(
2025, 9, day, 5, 0, 0,
tzinfo=ZoneInfo('America/Mexico_City')
)
ends_at = starts_at + timedelta(hours=2)
event = Event(
title=title,
starts_at=starts_at,
ends_at=ends_at,
max_attendees=10,
is_public=True
)
print(event.id)
events.append(event)
"""
users = [
User(username=f'{x}_user')
for x in range(10)
]
for user in users:
for event in events:
enroll_user(user=user, event=event)
events_dict = defaultdict(int)
for event in events:
starts_at = event.starts_at.date()
events_dict[starts_at] += 1
print(events_dict)
# Mostrar el día con más eventos.
# Mostrar el nombre del evento con más usuarios registrados
"""