About Object Duplication in Django
You can create a copy of Django model instance, by assigning its pk
to None
and saving the instance:
obj.pk = None
obj.save()
If there are any many-to-many or many-to-one relationships, you will have to copy them from the original manually.
Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.