Voucher bulk creation: More efficient implementation and async task

This commit is contained in:
Raphael Michel
2021-03-14 18:19:49 +01:00
parent 7eefd3dc59
commit 4a2ac110b3
8 changed files with 244 additions and 103 deletions

View File

@@ -12,8 +12,8 @@ class Thumbnail(models.Model):
unique_together = (('source', 'size'),)
def modelcopy(obj: models.Model):
n = obj.__class__()
def modelcopy(obj: models.Model, **kwargs):
n = obj.__class__(**kwargs)
for f in obj._meta.fields:
val = getattr(obj, f.name)
if isinstance(val, models.Model):