# Path: wagtailplus/views/chooser.py
# def get_model_permission(permission, model):
#     def get_context_data(self, **kwargs):
#     def get_form_class(self):
#     def get_search_filters(self):
#     def get_template_names(self):
#     def render_to_response(self, context, **response_kwargs):
#     def form_invalid(self, form):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def render_to_response(self, context, **response_kwargs):
# class ChooseView(ListView):
# class CreateView(_CreateView):
# class ChosenView(DetailView):
# class UpdateView(_UpdateView):
# 
# Path: wagtailplus/views/crud.py
# class IndexView(ListView):
# class BaseFormView(FormView):
#         class BaseChooserObjectList(BaseObjectList):
# class CreateView(BaseFormView, _CreateView):
# class UpdateView(BaseFormView, _UpdateView):
# class DeleteView(_DeleteView):
#     def get(self, request, *args, **kwargs):
#     def get_context_data(self, **kwargs):
#     def get_template_names(self):
#     def form_invalid(self, form):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def get_edit_handler_class(self):
#             def render_missing_fields(self):
#         def ChooserObjectList(children):
#     def get_form_class(self):
#     def delete(self, request, *args, **kwargs):
# 
# Path: wagtailplus/wagtailevents/models.py
# class BaseEvent(Event, TagSearchable):
#     """
#     Adds tags to schedule.Event.
#     """
#     tags = TaggableManager(blank=True)
# 
#     panels = [
#         FieldPanel('title', classname='full title'),
#         MultiFieldPanel([
#             FieldRowPanel([
#                 FieldPanel('start', classname='col6'),
#                 FieldPanel('end', classname='col6'),
#             ], classname='label-above'),
#         ], _(u'Date Range'), classname='publishing'),
#         FieldPanel('description'),
#         FieldPanel('rule'),
#         FieldPanel('tags'),
#     ]
# 
#     class Meta(object):
#         app_label           = 'wagtailevents'
#         verbose_name        = 'Event'
#         verbose_name_plural = 'Events'
#         ordering            = ('-start', 'title',)


from django.conf.urls import url
from django.contrib.auth.decorators import permission_required
from wagtailplus.views import chooser
from wagtailplus.views import crud
from .models import BaseEvent

urlpatterns = [
    url(
        r'^$',
        permission_required('wagtailadmin.access_admin')(crud.IndexView.as_view(
            model=BaseEvent,
            index_template='wagtailevents/events/index.html',
            results_template='wagtailevents/events/results.html'
        )),
        name='wagtailevents_index'
    ),
    url(
        r'^add/$',
        permission_required('wagtailevents.add_event')(crud.CreateView.as_view(
            model=BaseEvent,
            template_name='wagtailevents/events/add.html',
            success_url='wagtailevents_index'
        )),
        name='wagtailevents_add_event'
    ),
    url(
        r'^edit/(?P<pk>\d+)/$',
        permission_required('wagtailadmin.change_event')(crud.UpdateView.as_view(
            model=BaseEvent,
            template_name='wagtailevents/events/edit.html',
            success_url='wagtailevents_index'
        )),
        name='wagtailevents_edit_event'
    ),
    url(
        r'^delete/(?P<pk>\d+)/$',

# Path: wagtailplus/views/chooser.py
# def get_model_permission(permission, model):
#     def get_context_data(self, **kwargs):
#     def get_form_class(self):
#     def get_search_filters(self):
#     def get_template_names(self):
#     def render_to_response(self, context, **response_kwargs):
#     def form_invalid(self, form):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def render_to_response(self, context, **response_kwargs):
# class ChooseView(ListView):
# class CreateView(_CreateView):
# class ChosenView(DetailView):
# class UpdateView(_UpdateView):
# 
# Path: wagtailplus/views/crud.py
# class IndexView(ListView):
# class BaseFormView(FormView):
#         class BaseChooserObjectList(BaseObjectList):
# class CreateView(BaseFormView, _CreateView):
# class UpdateView(BaseFormView, _UpdateView):
# class DeleteView(_DeleteView):
#     def get(self, request, *args, **kwargs):
#     def get_context_data(self, **kwargs):
#     def get_template_names(self):
#     def form_invalid(self, form):
#     def form_valid(self, form):
#     def get_context_data(self, **kwargs):
#     def get_edit_handler_class(self):
#             def render_missing_fields(self):
#         def ChooserObjectList(children):
#     def get_form_class(self):
#     def delete(self, request, *args, **kwargs):
# 
# Path: wagtailplus/wagtailevents/models.py
# class BaseEvent(Event, TagSearchable):
#     """
#     Adds tags to schedule.Event.
#     """
#     tags = TaggableManager(blank=True)
# 
#     panels = [
#         FieldPanel('title', classname='full title'),
#         MultiFieldPanel([
#             FieldRowPanel([
#                 FieldPanel('start', classname='col6'),
#                 FieldPanel('end', classname='col6'),
#             ], classname='label-above'),
#         ], _(u'Date Range'), classname='publishing'),
#         FieldPanel('description'),
#         FieldPanel('rule'),
#         FieldPanel('tags'),
#     ]
# 
#     class Meta(object):
#         app_label           = 'wagtailevents'
#         verbose_name        = 'Event'
#         verbose_name_plural = 'Events'
#         ordering            = ('-start', 'title',)


# Path: wagtailplus/wagtailevents/admin_urls.py
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required
from wagtailplus.views import chooser
from wagtailplus.views import crud
from .models import BaseEvent

urlpatterns = [
    url(
        r'^$',
        permission_required('wagtailadmin.access_admin')(crud.IndexView.as_view(
            model=BaseEvent,
            index_template='wagtailevents/events/index.html',
            results_template='wagtailevents/events/results.html'
        )),
        name='wagtailevents_index'
    ),
    url(
        r'^add/$',
        permission_required('wagtailevents.add_event')(crud.CreateView.as_view(
            model=BaseEvent,
            template_name='wagtailevents/events/add.html',
            success_url='wagtailevents_index'
        )),
        name='wagtailevents_add_event'
    ),
    url(
        r'^edit/(?P<pk>\d+)/$',
        permission_required('wagtailadmin.change_event')(crud.UpdateView.as_view(
            model=BaseEvent,
            template_name='wagtailevents/events/edit.html',
            success_url='wagtailevents_index'
        )),
        name='wagtailevents_edit_event'
    ),
    url(
        r'^delete/(?P<pk>\d+)/$',

        permission_required('wagtailadmin.delete_event')(crud.DeleteView.as_view(
