# Path: monitoring/notifications/forms.py
# READONLY_TEXTINPUT = forms.TextInput(attrs={'readonly': 'readonly'})
# class BaseNotificationMethodForm(forms.SelfHandlingForm):
# class CreateMethodForm(BaseNotificationMethodForm):
# class DetailMethodForm(BaseNotificationMethodForm):
# class EditMethodForm(BaseNotificationMethodForm):
#     def _instantiate(cls, request, *args, **kwargs):
#     def _init_fields(self, readOnly=False, create=False):
#     def clean_period(self):
#     def clean_address(self):
#     def notification_types(self):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
# 
# Path: monitoring/notifications/tables.py
# class DeleteNotification(tables.DeleteAction):
# class CreateNotification(tables.LinkAction):
# class EditNotification(tables.LinkAction):
# class NotificationsFilterAction(tables.FilterAction):
# class NotificationsTable(tables.DataTable):
#     class Meta(object):
#     def action_present(count):
#     def action_past(count):
#     def allowed(self, request, datum=None):
#     def delete(self, request, obj_id):
#     def get_link_url(self):
#     def allowed(self, request, datum=None):
#     def get_link_url(self, datum):
#     def allowed(self, request, datum=None):
#     def filter(self, table, notifications, filter_string):
#     def get_object_id(self, obj):
#     def get_object_display(self, obj):


from django.contrib import messages
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext as _  # noqa
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon.utils import functions as utils
from monitoring import api
from monitoring.notifications import constants
from monitoring.notifications import forms as notification_forms
from monitoring.notifications import tables as notification_tables
from openstack_dashboard import policy

        prev_page_offset = prev_page_stack[-1] if prev_page_stack else None
        if prev_page_offset is not None:
            context["prev_page_offset"] = prev_page_offset

        if len(prev_page_stack) > PREV_PAGE_LIMIT:
            del prev_page_stack[0]
        prev_page_stack.append(page_offset)
        self.request.session['prev_page_stack'] = prev_page_stack

        return context


class NotificationCreateView(forms.ModalFormView):
    form_class = notification_forms.CreateMethodForm
    template_name = constants.TEMPLATE_PREFIX + 'create.html'
    success_url = reverse_lazy(constants.URL_PREFIX + 'index')

    def get_context_data(self, **kwargs):
        if not policy.check((('monitoring', 'monitoring:monitoring'), ), self.request):
            raise exceptions.NotAuthorized()
        context = super(NotificationCreateView, self). \
            get_context_data(**kwargs)
        context["cancel_url"] = self.get_success_url()
        action = constants.URL_PREFIX + 'notification_create'
        context["action_url"] = reverse(action)
        return context


class NotificationEditView(forms.ModalFormView):

# Path: monitoring/notifications/forms.py
# READONLY_TEXTINPUT = forms.TextInput(attrs={'readonly': 'readonly'})
# class BaseNotificationMethodForm(forms.SelfHandlingForm):
# class CreateMethodForm(BaseNotificationMethodForm):
# class DetailMethodForm(BaseNotificationMethodForm):
# class EditMethodForm(BaseNotificationMethodForm):
#     def _instantiate(cls, request, *args, **kwargs):
#     def _init_fields(self, readOnly=False, create=False):
#     def clean_period(self):
#     def clean_address(self):
#     def notification_types(self):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
# 
# Path: monitoring/notifications/tables.py
# class DeleteNotification(tables.DeleteAction):
# class CreateNotification(tables.LinkAction):
# class EditNotification(tables.LinkAction):
# class NotificationsFilterAction(tables.FilterAction):
# class NotificationsTable(tables.DataTable):
#     class Meta(object):
#     def action_present(count):
#     def action_past(count):
#     def allowed(self, request, datum=None):
#     def delete(self, request, obj_id):
#     def get_link_url(self):
#     def allowed(self, request, datum=None):
#     def get_link_url(self, datum):
#     def allowed(self, request, datum=None):
#     def filter(self, table, notifications, filter_string):
#     def get_object_id(self, obj):
#     def get_object_display(self, obj):


# Path: monitoring/notifications/views.py
from django.contrib import messages
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext as _  # noqa
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon.utils import functions as utils
from monitoring import api
from monitoring.notifications import constants
from monitoring.notifications import forms as notification_forms
from monitoring.notifications import tables as notification_tables
from openstack_dashboard import policy


        prev_page_offset = prev_page_stack[-1] if prev_page_stack else None
        if prev_page_offset is not None:
            context["prev_page_offset"] = prev_page_offset

        if len(prev_page_stack) > PREV_PAGE_LIMIT:
            del prev_page_stack[0]
        prev_page_stack.append(page_offset)
        self.request.session['prev_page_stack'] = prev_page_stack

        return context


class NotificationCreateView(forms.ModalFormView):
    form_class = notification_forms.CreateMethodForm
    template_name = constants.TEMPLATE_PREFIX + 'create.html'
    success_url = reverse_lazy(constants.URL_PREFIX + 'index')

    def get_context_data(self, **kwargs):
        if not policy.check((('monitoring', 'monitoring:monitoring'), ), self.request):
            raise exceptions.NotAuthorized()
        context = super(NotificationCreateView, self). \
            get_context_data(**kwargs)
        context["cancel_url"] = self.get_success_url()
        action = constants.URL_PREFIX + 'notification_create'
        context["action_url"] = reverse(action)
        return context


class NotificationEditView(forms.ModalFormView):

    form_class = notification_forms.EditMethodForm