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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d53c4be0c49b3b64896a9504cedb56f0c4d6f9f0fdf10bd6e7ee1a25ef58dcf9 |
|
MD5 | 3067f0e1eb870cfe22af22005b2e256b |
|
BLAKE2b-256 | 9a0b1a974ca0dd43ccfd1d4d216cce86bba64bbd1dc5e11d38206fc972e63d64 |
Close
Hashes for wagtailsnippetscopy-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7822a0c564de60d9a4f962746096c8abb7269a27ff9972255033e0b0709d55 |
|
MD5 | 53168603c214114873da805fa75a3875 |
|
BLAKE2b-256 | 3470812dbda374161d4ac46c07c60a833a31ba7cd36be3ad7425d08c376615bc |