Describe the bug
The repr of a single object can be enormous.
To Reproduce
Steps to reproduce the behavior:
You can try the following script:
# This creates 10 queues each of which has 3 tags randomly chosen from a
# set of 10.
import random
import dioptra.restapi.db.models as m
user = m.User("name", "password", "user@example.org")
group = m.Group("groupname", user)
tags = [m.Tag(f"tag_{i}", group, user) for i in range(10)]
queues = []
for i in range(10):
res = m.Resource("queue", group)
queues.append(m.Queue("a queue", res, user, f"queue_{i}"))
for queue in queues:
queue.tags.extend(random.sample(tags, k=3))
print(repr(queues[0]))
This will repr one of the queues so created. You'll want to redirect the output to a file and wait a bit. I've run this a couple times; both times, the resulting file was over 1GB in size!
Describe the bug The repr of a single object can be enormous.
To Reproduce Steps to reproduce the behavior:
You can try the following script:
This will repr one of the queues so created. You'll want to redirect the output to a file and wait a bit. I've run this a couple times; both times, the resulting file was over 1GB in size!
Expected behavior
A reasonably sized repr.