improve event organizer selection, show on web
This commit is contained in:
@ -1,2 +1,13 @@
|
||||
from wagtail.admin.viewsets.chooser import ChooserViewSet
|
||||
|
||||
# Create your views here.
|
||||
|
||||
class AssociationChooserViewSet(ChooserViewSet):
|
||||
model = "associations.AssociationPage"
|
||||
icon = "group"
|
||||
choose_one_text = "Choose an association"
|
||||
choose_another_text = "Choose another association"
|
||||
edit_item_text = "Edit this association"
|
||||
# form_fields = ["name"]
|
||||
|
||||
|
||||
association_chooser_viewset = AssociationChooserViewSet("association_chooser")
|
||||
|
8
dnscms/associations/wagtail_hooks.py
Normal file
8
dnscms/associations/wagtail_hooks.py
Normal file
@ -0,0 +1,8 @@
|
||||
from wagtail import hooks
|
||||
|
||||
from .views import association_chooser_viewset
|
||||
|
||||
|
||||
@hooks.register("register_admin_viewset")
|
||||
def register_viewset():
|
||||
return association_chooser_viewset
|
3
dnscms/associations/widgets.py
Normal file
3
dnscms/associations/widgets.py
Normal file
@ -0,0 +1,3 @@
|
||||
from .views import association_chooser_viewset
|
||||
|
||||
AssociationChooserWidget = association_chooser_viewset.widget_class
|
Reference in New Issue
Block a user