Copy A Snippet Feature for Wagtail CMS
Project description
'Copy A Snippet' Feature for Wagtail CMS
You can now "copy" snippets (non-page models) in Wagtail CMS
Installation
- Install the python package wagtailsnippetscopy from pip
pip install wagtailsnippetscopy
Alternatively, you can install download or clone this repo and call pip install -e .
.
- Add to INSTALLED_APPS in your settings.py:
'wagtailsnippetscopy',
- Register a model (with a title field name) you wish to enable copy functionality for:
from wagtailsnippetscopy.registry import snippet_copy_registry
snippet_copy_registry.register(YourModel, {})
- Add SnippetCopyMixin to your Snippet model in order to enable get_copy_url callback() for the model:
from wagtailsnippetscopy.models import SnippetCopyMixin
class Graph(SnippetCopyMixin, models.Model):
- If you wish copy link to automatically appear in modeladmin list you should add SnippetCopyModelAdminMixin to the ModelAdmin class:
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)
- Copy link follows the following pattern:
/admin/copy-snippet/<app_label>/<model_name>/<object_id>/
Bugs and suggestions
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for wagtailsnippetscopy-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e4dfb376fd039667f683f7e6f8a4f05dbadccf1566c1c2889af0b60b54f874 |
|
MD5 | 566a36429826546bbd9a25111b95b3c5 |
|
BLAKE2b-256 | 81895ef1256fc2984f4e6ecdee072a2646546f04cbc80981c6bd99bf74858d84 |
Close
Hashes for wagtailsnippetscopy-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bfc2fc9cc39db37458b8edebef3ea8dc06976015e80bc2c78f10f0517ef3888 |
|
MD5 | 9bf2be1b61d42e5e191a58f4ca979d9a |
|
BLAKE2b-256 | 7c47a0f7f3e3fa818bfd23c1598417e83fb40012511a30e93f56f3a0febc5619 |