src/pyams_alchemy/zmi/engine.py
changeset 2 9bf599d49c71
parent 1 d424ab95766d
child 16 26640dcbe036
equal deleted inserted replaced
1:d424ab95766d 2:9bf599d49c71
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 from z3c.table.column import GetAttrColumn
       
    13 from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager
       
    14 from pyams_skin.table import BaseTable
       
    15 from pyams_template.template import template_config
       
    16 
    12 
    17 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    18 
    14 
    19 
    15 
    20 # import standard library
    16 # import standard library
    21 
    17 
    22 # import interfaces
    18 # import interfaces
    23 from pyams_alchemy.interfaces import IAlchemyEngineUtility
    19 from pyams_alchemy.interfaces import IAlchemyEngineUtility
       
    20 from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager
    24 from pyams_skin.interfaces.viewlet import IToolbarAddingMenu, ITableItemColumnActionsMenu
    21 from pyams_skin.interfaces.viewlet import IToolbarAddingMenu, ITableItemColumnActionsMenu
    25 from pyams_skin.layer import IPyAMSLayer
    22 from pyams_skin.layer import IPyAMSLayer
    26 from pyams_zmi.layer import IAdminLayer
    23 from pyams_zmi.layer import IAdminLayer
    27 from z3c.form.interfaces import IDataExtractedEvent, DISPLAY_MODE
    24 from z3c.form.interfaces import IDataExtractedEvent, DISPLAY_MODE
    28 from zope.component.interfaces import ISite
    25 from zope.component.interfaces import ISite
    30 # import packages
    27 # import packages
    31 from pyams_alchemy.engine import PersistentAlchemyEngineUtility, get_user_session
    28 from pyams_alchemy.engine import PersistentAlchemyEngineUtility, get_user_session
    32 from pyams_form.form import AJAXEditForm, AJAXAddForm
    29 from pyams_form.form import AJAXEditForm, AJAXAddForm
    33 from pyams_form.schema import CloseButton
    30 from pyams_form.schema import CloseButton
    34 from pyams_pagelet.pagelet import pagelet_config
    31 from pyams_pagelet.pagelet import pagelet_config
       
    32 from pyams_skin.table import BaseTable
    35 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
    33 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
       
    34 from pyams_template.template import template_config
    36 from pyams_utils.registry import query_utility
    35 from pyams_utils.registry import query_utility
    37 from pyams_utils.url import absolute_url
    36 from pyams_utils.url import absolute_url
    38 from pyams_viewlet.viewlet import viewlet_config, Viewlet
    37 from pyams_viewlet.viewlet import viewlet_config, Viewlet
    39 from pyams_zmi.control_panel import UtilitiesTable
    38 from pyams_zmi.control_panel import UtilitiesTable
    40 from pyams_zmi.form import AdminDialogEditForm, AdminDialogAddForm
    39 from pyams_zmi.form import AdminDialogEditForm, AdminDialogAddForm
    41 from pyramid.events import subscriber
    40 from pyramid.events import subscriber
    42 from pyramid.view import view_config
    41 from pyramid.view import view_config
    43 from z3c.form import field, button
    42 from z3c.form import field, button
       
    43 from z3c.table.column import GetAttrColumn
    44 from zope.interface import Interface, Invalid
    44 from zope.interface import Interface, Invalid
    45 from zope.schema import Text
    45 from zope.schema import Text
    46 
    46 
    47 from pyams_alchemy import _
    47 from pyams_alchemy import _
    48 
    48 
   132                 view=UtilitiesTable, manager=ITableItemColumnActionsMenu, permission='system.manage')
   132                 view=UtilitiesTable, manager=ITableItemColumnActionsMenu, permission='system.manage')
   133 class AlchemyEngineTestMenu(ToolbarMenuItem):
   133 class AlchemyEngineTestMenu(ToolbarMenuItem):
   134     """SQLAlchemy engine test menu"""
   134     """SQLAlchemy engine test menu"""
   135 
   135 
   136     label = _("Test connection...")
   136     label = _("Test connection...")
       
   137     label_css_class = 'fa fa-fw fa-play'
   137     url = 'test-sqlalchemy-engine.html'
   138     url = 'test-sqlalchemy-engine.html'
   138     modal_target = True
   139     modal_target = True
   139     stop_propagation = True
   140     stop_propagation = True
   140 
   141 
   141 
   142