Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail 6.0 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ StreamField([
### Customizing the widget's display and behaviour

```python
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
from instance_selector.registry import registry
from instance_selector.selectors import ModelAdminInstanceSelector
from .models import MyModel
Expand Down
1 change: 0 additions & 1 deletion example/example_app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
default_app_config = "%s.apps.AppConfig" % __name__
6 changes: 4 additions & 2 deletions example/example_app/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from django.utils.safestring import mark_safe
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register

from instance_selector.registry import registry
from instance_selector.selectors import ModelAdminInstanceSelector
from .models import Shop, Product, Image

from .models import Image, Product, Shop


@modeladmin_register
Expand Down
5 changes: 2 additions & 3 deletions example/example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["*"]


# Application definition
Expand All @@ -39,7 +39,7 @@
"django.contrib.staticfiles",
"wagtail.admin",
"wagtail",
"wagtail.contrib.modeladmin",
"wagtail_modeladmin",
"wagtail.contrib.settings",
"wagtail.users",
"wagtail.documents",
Expand Down Expand Up @@ -113,7 +113,6 @@

USE_I18N = True

USE_L10N = True

USE_TZ = True

Expand Down
3 changes: 2 additions & 1 deletion example/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
django>=3.2
wagtail>=4.1
wagtail>=5.2
wagtail-modeladmin==2.0.0
wagtail-instance-selector
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// intance_selector/static/intance_selector/instance-selector-controller.js

class InstanceSelectorController extends window.StimulusModule.Controller {
static values = { config: Object };

connect() {
create_instance_selector_widget(this.configValue);
console.log(this.configValue);
}
}

window.wagtail.app.register('instance-selector', InstanceSelectorController);
Loading