You can now "copy" snippets (non-page models) in Wagtail CMS
pip install wagtailsnippetscopy
Alternatively, you can install download or clone this repo and call pip install -e .
.
'wagtailsnippetscopy',
from wagtailsnippetscopy.registry import snippet_copy_registry
snippet_copy_registry.register(YourModel, {})
from wagtailsnippetscopy.models import SnippetCopyMixin
class Graph(SnippetCopyMixin, models.Model):
In admin.py:
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtailsnippetscopy.admin import SnippetCopyModelAdminMixin
from .models import YourModel
class YourModelAdmin(SnippetCopyModelAdminMixin, ModelAdmin):
model = YourModel
modeladmin_register(GraphAdmin)
/admin/copy-snippet/<app_label>/<model_name>/<object_id>/
If you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.
https://github.com/timonweb/wagtailsnippetscopy/issues
by Tim Kamanin