{"repo":"tj-django/django-clone","free":true,"listed":false,"github":"https://github.com/tj-django/django-clone","clone":"git clone https://github.com/tj-django/django-clone.git","description":"Controlled Django model instance replication.","language":"Python","stars":130,"topics":["django","duplicating-models","clone","duplicate","cloning","django-model-clone","django-clone","django-admin","bulk-cloning","clonemixin-attributes"],"license":"MIT","category":"security-tools","readme_excerpt":"Python Django Downloads Code Style :---------: :-------: :-----------: :--------------: PyPI Test Vulnerabilities Coverage Code Quality Pre-Commit :---------------: :----: :---------------: :--------: :-------------: :-------------: django-clone Create copies of a model instance with explicit control on how the instance should be duplicated (limiting fields or related objects copied) with unique field detection. This solves the problem introduced by using instance.pk = None and instance.save() which results in copying more object state than required. Features 100% test coverage. More control over how a model instance should be duplicated Multi Database support i.e Create duplicates on one or more databases. Restrict fields used for creating a duplicate instance. Detects unique fields and naively adds a suffix copy {count} to each duplicate instance (for supported fields only). Optionally differentiate between a duplicate instance and the original by appending a copy suffix to non unique fields (for supported fields only). Table of Contents Installation pip poetry Usage Subclassing the CloneModel Using the CloneMixin Using the CloneModel Duplicating a model instance Bulk cloning a model Creating clones without subclassing CloneMixin . CloneMixin attributes Explicit (include only these fields) Implicit (include all except these fields) Django Admin Duplicating Models from the Django Admin view. List View Change View CloneModelAdmin class attributes Advanced Usage Signals pre cl","default_branch":null,"files":null,"tree":[],"storefront":"/r/tj-django","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tj-django/django-clone/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}