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.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bffccbf36d73742443bed1333e115a44a6fc2796720b58349573dd88af35dff4 |
|
MD5 | 6de63c1424200b00a55a2e525fad50ef |
|
BLAKE2b-256 | ae6036994e096fc50b3f07cb95d205d1780627aa42bc42f247ffaedd27a914d5 |
Close
Hashes for wagtailsnippetscopy-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 836f7cbb3c3dd52b220aaf6b17dca736f23ff7fdea9e13c42a47f6371a1cce1e |
|
MD5 | f4e238c79c5e7b7ac634d112b47392b1 |
|
BLAKE2b-256 | 4b40c2864f01ec0b2852bbae82b611a930dc5928e707611492651a8728f0a680 |