Model Admin extension that utilizes the Wagtail collections
Project description
Collection Model Admin
Installation
pip install wagtail-collectionmodeladmin
Development
Checkout this repo, create a local virtual environment and install dependencies:
pip install -e .
Create a new demo
wagtail project:
wagtail start demo
We will use the home
app as the base for our demo. Add a new Model
in demo/home/models.py
:
from django.db import models
from wagtail.core.models import CollectionMember
class Demo(CollectionMember, models.Model):
demo_field = models.CharField()
Add the wagtail.contrib.modeladmin
to the demo INSTALLED_APPS
at demo/demo/settings/base.py
:
INSTALLED_APPS = [
...
'wagtail.contrib.modeladmin',
]
Create the wagtail hooks that will inject the model admin in demo/home/wagtail_hooks.py
:
from wagtail.contrib.modeladmin.options import modeladmin_register
from collectionmodeladmin.base import CollectionModelAdmin
from home.models import Demo
class DemoModelAdmin(CollectionModelAdmin):
model = Demo
modeladmin_register(DemoModelAdmin)
Then as usual make migrations, apply them, create a superuser and start the Django server.
cd demo
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Project details
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
File details
Details for the file wagtail-collectionmodeladmin-0.1.4.tar.gz
.
File metadata
- Download URL: wagtail-collectionmodeladmin-0.1.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ecb40212f2663c4b0e2a1a2dcaaec71f23d1ca7a591ee2e847de5b43fd35c4 |
|
MD5 | 2752464c439a15b98a5246dae6f73403 |
|
BLAKE2b-256 | 1cae775fa0fba1887bee8b605f7761dba2b0336d93e9164483ea975e5acffa05 |
File details
Details for the file wagtail_collectionmodeladmin-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: wagtail_collectionmodeladmin-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b9c6e2e985a4cfb0b14d248bf438ebb53e11be4fb7cd350fb0d1928005f3eb |
|
MD5 | 66c5523ae9767b4d1ca1165c5c0f9929 |
|
BLAKE2b-256 | bac43b36ef4b4ceb38eded8f667a7bcd9e7fbdb5c95014c735cda42775094977 |