• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python api.register_top_menu函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中navigation.api.register_top_menu函数的典型用法代码示例。如果您正苦于以下问题:Python register_top_menu函数的具体用法?Python register_top_menu怎么用?Python register_top_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了register_top_menu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: register

    def register(cls, app_name):
        logger.debug('Trying to import: %s' % app_name)
        try:
            app_module = import_module(app_name)
        except ImportError:
            logger.debug('Unable to import app: %s' % app_name)
        else:
            logger.debug('Trying to import registry from: %s' % app_name)
            try:
                registration = import_module('%s.registry' % app_name)
            except ImportError:
                logger.debug('Unable to import registry for app: %s' % app_name)
            else:
                if not getattr(registration, 'disabled', False):
                    app = App()
                    app.name=app_name
                    # If there are not error go ahead with the stored app instance
                    app.label = getattr(registration, 'label', app_name)
                    app.description = getattr(registration, 'description', u'')
                          
                    for link in getattr(registration, 'setup_links', []):
                        logger.debug('setup link: %s' % link)
                        register_setup(link) 

                    for link in getattr(registration, 'tool_links', []):
                        logger.debug('tool link: %s' % link)
                        register_tool(link)
                        
                    for index, link in enumerate(getattr(registration, 'menu_links', [])):
                        logger.debug('menu_link: %s' % link)
                        register_top_menu(name='%s.%s' % (app_name, index), link=link)
开发者ID:Code4PuertoRico,项目名称:rua,代码行数:31,代码来源:models.py


示例2: register

    def register(cls, app_name):
        logger.debug('Trying to import: %s' % app_name)
        try:
            app_module = import_module(app_name)
        except ImportError:
            logger.debug('Unable to import app: %s' % app_name)
        else:
            logger.debug('Trying to import registry from: %s' % app_name)
            try:
                registration = import_module('%s.registry' % app_name)
            except ImportError as e:
                logger.debug('Unable to import registry for app: %s; %s' % (app_name, e))
            else:
                if not getattr(registration, 'disabled', False):
                    app = App()
                    app.name = app_name
                    # If there are not error go ahead with the stored app instance
                    app.label = getattr(registration, 'label', app_name)
                    app.description = getattr(registration, 'description', u'')

                    for link in getattr(registration, 'setup_links', []):
                        logger.debug('setup link: %s' % link)
                        register_setup(link)

                    for link in getattr(registration, 'tool_links', []):
                        logger.debug('tool link: %s' % link)
                        register_tool(link)

                    for index, link in enumerate(getattr(registration, 'menu_links', [])):
                        logger.debug('menu_link: %s' % link)
                        register_top_menu(name='%s.%s' % (app_name, index), link=link)

                    for cleanup_function in getattr(registration, 'cleanup_functions', []):
                        logger.debug('cleanup_function: %s' % cleanup_function)
                        Cleanup(cleanup_function)

                    for bootstrap_model in getattr(registration, 'bootstrap_models', []):
                        logger.debug('bootstrap_model: %s' % bootstrap_model)
                        BootstrapModel(model_name=bootstrap_model.get('name'), app_name=app_name, sanitize=bootstrap_model.get('sanitize', True), dependencies=bootstrap_model.get('dependencies'))

                    version_0_api_services = getattr(registration, 'version_0_api_services', [])
                    logger.debug('version_0_api_services: %s' % version_0_api_services)

                    if version_0_api_services:
                        api_endpoint = APIEndPoint(app_name)

                        for service in version_0_api_services:
                            api_endpoint.add_service(**service)
开发者ID:EmlynC,项目名称:mayan-edms,代码行数:48,代码来源:models.py


示例3: register_top_menu

__version_info__ = {
    'major': 0,
    'minor': 7,
    'micro': 6,
    'releaselevel': 'final',
    'serial': 0
}

#setup_views = []
#setup_views.extend(permission_views)
#setup_views.extend(user_management_views)
#setup_views.extend(['setting_list'])

if not DISABLE_HOME_VIEW:
    register_top_menu('home', link={'text': _(u'home'), 'view': 'home', 'famfam': 'house'}, position=0)
if not SIDE_BAR_SEARCH:
    register_top_menu('search', link={'text': _(u'search'), 'view': 'search', 'famfam': 'zoom'}, children_path_regex=[r'^search/'])
    
register_top_menu('tools', link=tools_menu, children_views=['statistics', 'history_list', 'formats_list'])
#register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setting_list', 'famfam': 'cog'}, children=setup_views)
register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setting_list', 'famfam': 'cog'}, children_path_regex=[r'^settings/', r'^user_management/', r'^permissions', r'^documents/type', r'^metadata/setup'])
register_top_menu('about', link={'text': _(u'about'), 'view': 'about', 'famfam': 'information'})

register_links(['tools_menu', 'statistics', 'history_list', 'history_view', 'formats_list'], [tools_menu, statistics, history_list, formats_list, sentry], menu_name='secondary_menu')

setup_links = [check_settings, role_list, user_list, group_list, document_types, setup_metadata_type_list, setup_metadata_set_list, admin_site]
register_links(['setting_list'], setup_links, menu_name='secondary_menu')
register_links(permission_views, setup_links, menu_name='secondary_menu')
register_links(user_management_views, setup_links, menu_name='secondary_menu')
register_links(document_type_views, setup_links, menu_name='secondary_menu')
开发者ID:mrcrabby,项目名称:mayan,代码行数:30,代码来源:__init__.py


示例4: import

    folder_document_multiple_remove, folder_view, folder_add_document,
    folder_add_multiple_documents, document_folder_list, folder_acl_list,
    folders_main_menu_link)
from .models import Folder
from .permissions import (PERMISSION_FOLDER_CREATE,
    PERMISSION_FOLDER_EDIT, PERMISSION_FOLDER_DELETE,
    PERMISSION_FOLDER_REMOVE_DOCUMENT, PERMISSION_FOLDER_VIEW,
    PERMISSION_FOLDER_ADD_DOCUMENT)

register_multi_item_links(['folder_view'], [folder_document_multiple_remove])

register_links(Folder, [folder_view, folder_edit, folder_delete, folder_acl_list])

register_links([Folder, 'folder_list', 'folder_create'], [folder_list, folder_create], menu_name='secondary_menu')

register_top_menu(name='folders', link=folders_main_menu_link, children_views=['folder_list', 'folder_create', 'folder_edit', 'folder_delete', 'folder_view', 'folder_document_multiple_remove'])

register_links(Document, [document_folder_list], menu_name='form_header')

register_sidebar_template(['folder_list'], 'folders_help.html')

register_links(['document_folder_list', 'folder_add_document'], [folder_add_document], menu_name="sidebar")

register_multi_item_links(['document_find_duplicates', 'folder_view', 'index_instance_node_view', 'document_type_document_list', 'search', 'results', 'document_group_view', 'document_list', 'document_list_recent', 'tag_tagged_item_list'], [folder_add_multiple_documents])

class_permissions(Folder, [
    PERMISSION_FOLDER_EDIT,
    PERMISSION_FOLDER_DELETE,
    PERMISSION_FOLDER_VIEW,
    ACLS_EDIT_ACL,
    ACLS_VIEW_ACL
开发者ID:rosarior,项目名称:mayan,代码行数:31,代码来源:__init__.py


示例5: is_superuser

    'releaselevel': 'beta',
    'serial': 0
}


def is_superuser(context):
    return context['request'].user.is_staff or context['request'].user.is_superuser

maintenance_menu = {'text': _(u'maintenance'), 'view': 'maintenance_menu', 'famfam': 'wrench', 'icon': 'wrench.png'}
statistics = {'text': _(u'statistics'), 'view': 'statistics', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
diagnostics = {'text': _(u'diagnostics'), 'view': 'diagnostics', 'famfam': 'pill', 'icon': 'pill.png'}
sentry = {'text': _(u'sentry'), 'view': 'sentry', 'famfam': 'bug', 'icon': 'bug.png', 'condition': is_superuser}
admin_site = {'text': _(u'admin site'), 'view': 'admin:index', 'famfam': 'keyboard', 'icon': 'keyboard.png', 'condition': is_superuser}

if not DISABLE_HOME_VIEW:
    register_top_menu('home', link={'text': _(u'home'), 'view': 'home', 'famfam': 'house'}, position=0)
if not SIDE_BAR_SEARCH:
    register_top_menu('search', link={'text': _(u'search'), 'view': 'search', 'famfam': 'zoom'}, children_path_regex=[r'^search/'])


def get_version():
    '''
    Return the formatted version information
    '''
    vers = ['%(major)i.%(minor)i' % __version_info__, ]

    if __version_info__['micro']:
        vers.append('.%(micro)i' % __version_info__)
    if __version_info__['releaselevel'] != 'final':
        vers.append('%(releaselevel)s%(serial)i' % __version_info__)
    return ''.join(vers)
开发者ID:simone,项目名称:mayan-edms,代码行数:31,代码来源:__init__.py


示例6: register_top_menu

from django.utils.translation import ugettext_lazy as _

from navigation.api import register_top_menu


#TODO: FIXME dynamic children_path_regext on api register_setup
register_top_menu('tools', link={'text': _(u'tools'), 'view': 'tools_list', 'famfam': 'wrench'}, children_views=['statistics', 'history_list', 'formats_list'], position=-3)
开发者ID:IHLeanne,项目名称:mayan,代码行数:7,代码来源:__init__.py


示例7: register_top_menu

from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from navigation.api import register_top_menu
from project_setup.api import register_setup
from project_tools.api import register_tool

from .links import admin_site, maintenance_menu
from .classes import FrontPageButton  # NOQA

register_top_menu('home', link={'text': _('Home'), 'view': 'main:home', 'famfam': 'house'}, position=0)
register_setup(admin_site)
register_tool(maintenance_menu)
开发者ID:BangorUniversity,项目名称:mayan-edms,代码行数:14,代码来源:__init__.py


示例8: register_model_list_columns

    except Exception, exc:
        return exc

register_model_list_columns(Document, [
        {'name':_(u'thumbnail'), 'attribute':
            lambda x: document_thumbnail(x)
        },
        {'name':_(u'tags'), 'attribute':
            lambda x: get_tags_inline_widget_simple(x)
        },
        {'name':_(u'metadata'), 'attribute':
            lambda x: get_metadata_string(x)
        },
    ])

register_top_menu(
    'documents', 
    link={'famfam': 'page', 'text': _(u'documents'), 'view': 'document_list_recent'}, 
    children_path_regex=[
        r'^documents/[^t]', r'^metadata/[^s]', r'comments', r'tags/document', r'grouping/[^s]', r'history/list/for_object/documents'
    ],
    position=0
)

register_sidebar_template(['document_list_recent'], 'recent_document_list_help.html')
register_sidebar_template(['document_type_list'], 'document_types_help.html')

register_links(Document, [document_view_simple], menu_name='form_header', position=0)
register_links(Document, [document_view_advanced], menu_name='form_header', position=1)
register_links(Document, [document_history_view], menu_name='form_header')
开发者ID:mrcrabby,项目名称:mayan,代码行数:30,代码来源:__init__.py


示例9: _

index_setup_list = {'text': _(u'index list'), 'view': 'index_setup_list', 'famfam': 'tab', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP]}
index_setup_create = {'text': _(u'create index'), 'view': 'index_setup_create', 'famfam': 'tab_add', 'permissions': [PERMISSION_DOCUMENT_INDEXING_CREATE]}
index_setup_edit = {'text': _(u'edit'), 'view': 'index_setup_edit', 'args': 'index.pk', 'famfam': 'tab_edit', 'permissions': [PERMISSION_DOCUMENT_INDEXING_EDIT]}
index_setup_delete = {'text': _(u'delete'), 'view': 'index_setup_delete', 'args': 'index.pk', 'famfam': 'tab_delete', 'permissions': [PERMISSION_DOCUMENT_INDEXING_DELETE]}
index_setup_view = {'text': _(u'tree template'), 'view': 'index_setup_view', 'args': 'index.pk', 'famfam': 'textfield', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP]}

template_node_create = {'text': _(u'new child node'), 'view': 'template_node_create', 'args': 'node.pk', 'famfam': 'textfield_add', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP]}
template_node_edit = {'text': _(u'edit'), 'view': 'template_node_edit', 'args': 'node.pk', 'famfam': 'textfield', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP], 'conditional_disable': is_root_node}
template_node_delete = {'text': _(u'delete'), 'view': 'template_node_delete', 'args': 'node.pk', 'famfam': 'textfield_delete', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP], 'conditional_disable': is_root_node}

index_list = {'text': _(u'index list'), 'view': 'index_list', 'famfam': 'tab', 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW]}

index_parent = {'text': _(u'go up one level'), 'view': 'index_instance_node_view', 'args': 'object.parent.pk', 'famfam': 'arrow_up', 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW], 'dont_mark_active': True, 'condition': is_not_instance_root_node}
document_index_list = {'text': _(u'indexes'), 'view': 'document_index_list', 'args': 'object.pk', 'famfam': 'folder_page', 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW, PERMISSION_DOCUMENT_VIEW]}

register_top_menu('indexes', link={'text': _('indexes'), 'famfam': 'tab', 'view': 'index_list', 'children_view_regex': [r'^index_[i,l]']})

rebuild_index_instances = {'text': _('rebuild indexes'), 'view': 'rebuild_index_instances', 'famfam': 'folder_page', 'permissions': [PERMISSION_DOCUMENT_INDEXING_REBUILD_INDEXES], 'description': _(u'Deletes and creates from scratch all the document indexes.')}

register_maintenance_links([rebuild_index_instances], namespace='document_indexing', title=_(u'Indexes'))

register_sidebar_template(['index_instance_list'], 'indexing_help.html')

register_links(IndexInstanceNode, [index_parent])

register_links(Document, [document_index_list], menu_name='form_header')

register_setup(index_setup)

register_links([Index, 'index_setup_list', 'index_setup_create', 'template_node_edit', 'template_node_delete'], [index_setup_list, index_setup_create], menu_name='secondary_menu')
开发者ID:AmiGanguli,项目名称:mayan,代码行数:30,代码来源:__init__.py


示例10: _

from django.utils.translation import ugettext_lazy as _

from navigation.api import register_top_menu

#TODO: FIXME dynamic children_path_regext on api register_setup
#register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setup_list', 'famfam': 'cog'}, children_path_regex=[r'^settings/', r'^user_management/', r'^permissions'], position=-2)
register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setup_list'}, children_path_regex=[r'^settings/', r'^user_management/', r'^permissions'], position=-2)
开发者ID:pombredanne,项目名称:redirector,代码行数:7,代码来源:__init__.py


示例11: _

folder_delete = {'text': _('delete'), 'view': 'folder_delete', 'args': 'object.pk', 'famfam': 'folder_delete', 'permissions': [PERMISSION_FOLDER_DELETE]}
folder_document_multiple_remove = {'text': _('remove from folder'), 'view': 'folder_document_multiple_remove', 'args': 'object.pk', 'famfam': 'folder_delete', 'permissions': [PERMISSION_FOLDER_REMOVE_DOCUMENT]}
folder_view = {'text': _(u'folder documents'), 'view': 'folder_view', 'args': 'object.pk', 'famfam': 'folder_go', 'permissions': [PERMISSION_FOLDER_VIEW]}
folder_add_document = {'text': _('add to a folder'), 'view': 'folder_add_document', 'args': 'object.pk', 'famfam': 'folder_add', 'permissions': [PERMISSION_FOLDER_ADD_DOCUMENT]}
folder_add_multiple_documents = {'text': _('add to folder'), 'view': 'folder_add_multiple_documents', 'famfam': 'folder_add', 'permissions': [PERMISSION_FOLDER_ADD_DOCUMENT]}
document_folder_list = {'text': _(u'folders'), 'view': 'document_folder_list', 'args': 'object.pk', 'famfam': 'folder_user', 'permissions': [PERMISSION_DOCUMENT_VIEW], 'children_view_regex': [r'folder']}

folder_acl_list = {'text': _(u'ACLs'), 'view': 'folder_acl_list', 'args': 'object.pk', 'famfam': 'lock', 'permissions': [ACLS_VIEW_ACL]}

register_multi_item_links(['folder_view'], [folder_document_multiple_remove])

register_links(Folder, [folder_view, folder_edit, folder_delete, folder_acl_list])

register_links([Folder, 'folder_list', 'folder_create'], [folder_list, folder_create], menu_name='secondary_menu')

register_top_menu(name='folders', link={'text': _('folders'), 'famfam': 'folder_user', 'view': 'folder_list'}, children_views=['folder_list', 'folder_create', 'folder_edit', 'folder_delete', 'folder_view', 'folder_document_multiple_remove'])

register_links(Document, [document_folder_list], menu_name='form_header')

register_sidebar_template(['folder_list'], 'folders_help.html')

register_links(['document_folder_list', 'folder_add_document'], [folder_add_document], menu_name="sidebar")

register_multi_item_links(['document_find_duplicates', 'folder_view', 'index_instance_node_view', 'document_type_document_list', 'search', 'results', 'document_group_view', 'document_list', 'document_list_recent', 'tag_tagged_item_list'], [folder_add_multiple_documents])

class_permissions(Folder, [
    PERMISSION_FOLDER_EDIT,
    PERMISSION_FOLDER_DELETE,
    PERMISSION_FOLDER_VIEW,
    ACLS_EDIT_ACL,
    ACLS_VIEW_ACL
开发者ID:matinfo,项目名称:mayan,代码行数:31,代码来源:__init__.py


示例12: register_top_menu

from django.utils.translation import ugettext_lazy as _

from navigation.api import register_top_menu

tool_link = register_top_menu('tools', link={'text': _(u'tools'), 'view': 'tools_list', 'famfam': 'wrench'}, position=-3)
开发者ID:AmiGanguli,项目名称:mayan,代码行数:5,代码来源:__init__.py


示例13: register_top_menu

from django.utils.translation import ugettext_lazy as _

from navigation.api import register_top_menu

#TODO: FIXME dynamic children_path_regext on api register_setup
register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setup_list', 'famfam': 'cog'}, children_path_regex=[r'^settings/', r'^user_management/', r'^permissions', r'^documents/type', r'^metadata/setup', r'sources/setup'], position=-2)
开发者ID:IHLeanne,项目名称:mayan,代码行数:6,代码来源:__init__.py


示例14: _

queue_document_list = {'text': _(u'queue document list'), 'view': 'queue_document_list', 'famfam': 'hourglass', 'permissions': [PERMISSION_OCR_DOCUMENT]}
node_active_list = {'text': _(u'active tasks'), 'view': 'node_active_list', 'famfam': 'server_chart', 'permissions': [PERMISSION_OCR_DOCUMENT]}

register_links(Document, [submit_document])
register_links(DocumentQueue, [document_queue_disable, document_queue_enable])

register_multi_item_links(['queue_document_list'], [re_queue_multiple_document, queue_document_multiple_delete])

register_links(['queue_document_list', 'node_active_list'], [queue_document_list, node_active_list], menu_name='secondary_menu')


register_tool(all_document_ocr_cleanup, namespace='ocr', title=_(u'OCR'))

#Menus
register_top_menu('ocr', link={'text': _('OCR'), 'famfam': 'hourglass', 'view': 'queue_document_list'}, children_path_regex=[r'^ocr/'])

try:
    default_queue, created = DocumentQueue.objects.get_or_create(name='default')
    if created:
        default_queue.label = ugettext(u'Default')
        default_queue.save()
except DatabaseError:
    #syncdb
    pass


def document_post_save(sender, instance, **kwargs):
    if kwargs.get('created', False):
        if AUTOMATIC_OCR:
            DocumentQueue.objects.queue_document(instance)
开发者ID:mrcrabby,项目名称:mayan,代码行数:30,代码来源:__init__.py


示例15: register_top_menu

from __future__ import absolute_import

from navigation.api import register_top_menu

from .links import link_tools_menu

tool_menu = register_top_menu('tools', link=link_tools_menu, position=-3)
开发者ID:Code4PuertoRico,项目名称:rua,代码行数:7,代码来源:__init__.py


示例16: APIEndPoint

APIEndPoint('tags')

register_model_list_columns(Tag, [
    {
        'name': _('Preview'),
        'attribute': encapsulate(lambda x: single_tag_widget(x))
    },
    {
        'name': _('Tagged items'),
        'attribute': encapsulate(lambda x: x.documents.count())
    }
])

register_model_list_columns(Document, [
    {
        'name': _('Tags'), 'attribute':
        encapsulate(lambda x: get_tags_inline_widget_simple(x))
    },
])

register_top_menu('tags', link={'text': _('Tags'), 'view': 'tags:tag_list', 'famfam': 'tag_blue'})

register_links(Tag, [tag_tagged_item_list, tag_edit, tag_acl_list, tag_delete])
register_links([Tag], [tag_multiple_delete], menu_name='multi_item_links')
register_links([Tag, 'tags:tag_list', 'tags:tag_create'], [tag_list, tag_create], menu_name='secondary_menu')

register_links(Document, [tag_document_list], menu_name='form_header')
register_links(['tags:document_tags', 'tags:tag_remove', 'tags:tag_multiple_remove', 'tags:tag_attach'], [tag_attach], menu_name='sidebar')
register_links(['tags:document_tags'], [single_document_multiple_tag_remove], menu_name='multi_item_links')
register_links([Document], [tag_multiple_attach, multiple_documents_selection_tag_remove, link_spacer], menu_name='multi_item_links')
开发者ID:BangorUniversity,项目名称:mayan-edms,代码行数:30,代码来源:__init__.py


示例17: register_links

register_links([Reminder], [comments_for_object], menu_name='form_header')

register_multi_item_links(
    [
        'reminder_list', 'reminder_list_all', 'expired_remider_list',
        'expired_remider_list_all', 'future_expired_remider_list',
        'future_expired_remider_list_all'
    ],
    [
        reminder_multiple_delete
    ]
)

register_top_menu('reminders',
    link={'famfam': 'hourglass', 'text': _(u'reminders'), 'view': 'reminder_list'},
    children_path_regex=[r'^reminders', r'comments'], position=0
)

register_model_list_columns(Reminder, [
        {
            'name': _(u'created'),
            'attribute': lambda x: x.datetime_created
        },
        {
            'name': _(u'expires'),
            'attribute': lambda x: x.datetime_expire
        },
        {
            'name': _('days'),
            'attribute': lambda x: (x.datetime_expire - x.datetime_created).days
        },
开发者ID:Code4PuertoRico,项目名称:cujo,代码行数:31,代码来源:__init__.py


示例18: document_index_delete


@receiver(post_delete, dispatch_uid='document_index_delete', sender=Document)
def document_index_delete(sender, **kwargs):
    task_delete_empty_index_nodes.apply_async(queue='indexing')


@receiver(post_save, dispatch_uid='document_metadata_index_update', sender=DocumentMetadata)
def document_metadata_index_update(sender, **kwargs):
    task_index_document.apply_async(kwargs=dict(document_id=kwargs['instance'].document.pk), queue='indexing')


@receiver(post_delete, dispatch_uid='document_metadata_index_post_delete', sender=DocumentMetadata)
def document_metadata_index_post_delete(sender, **kwargs):
    task_index_document.apply_async(kwargs=dict(document_id=kwargs['instance'].document.pk), queue='indexing')


register_maintenance_links([rebuild_index_instances], namespace='document_indexing', title=_('Indexes'))

register_links(Document, [document_index_list], menu_name='form_header')
register_links([Index, 'indexing:index_setup_list', 'indexing:index_setup_create'], [index_setup_list, index_setup_create], menu_name='secondary_menu')
register_links(Index, [index_setup_edit, index_setup_view, index_setup_document_types, index_setup_delete])
register_links(IndexInstanceNode, [index_parent])
register_links(IndexTemplateNode, [template_node_create, template_node_edit, template_node_delete])

register_setup(index_setup)

register_top_menu('indexes', document_index_main_menu_link)

APIEndPoint('indexes', app_name='document_indexing')
开发者ID:BangorUniversity,项目名称:mayan-edms,代码行数:28,代码来源:__init__.py


示例19: initialize_document_checkout_extra_methods

def initialize_document_checkout_extra_methods():
    Document.add_to_class('is_checked_out', lambda document: DocumentCheckout.objects.is_document_checked_out(document))
    Document.add_to_class('check_in', lambda document, user=None: DocumentCheckout.objects.check_in_document(document, user))
    Document.add_to_class('checkout_info', lambda document: DocumentCheckout.objects.document_checkout_info(document))
    Document.add_to_class('checkout_state', lambda document: DocumentCheckout.objects.document_checkout_state(document))
    Document.add_to_class('is_new_versions_allowed', lambda document, user=None: DocumentCheckout.objects.is_document_new_versions_allowed(document, user))


app.conf.CELERYBEAT_SCHEDULE.update({
    'check_expired_check_outs': {
        'task': 'checkouts.tasks.task_check_expired_check_outs',
        'schedule': timedelta(seconds=CHECK_EXPIRED_CHECK_OUTS_INTERVAL),
        'options': {'queue': 'checkouts'}
    },
})

class_permissions(Document, [
    PERMISSION_DOCUMENT_CHECKOUT,
    PERMISSION_DOCUMENT_CHECKIN,
    PERMISSION_DOCUMENT_CHECKIN_OVERRIDE,
    PERMISSION_DOCUMENT_RESTRICTIONS_OVERRIDE
])

initialize_document_checkout_extra_methods()

register_links(Document, [checkout_info], menu_name='form_header')
register_links(['checkouts:checkout_info', 'checkouts:checkout_document', 'checkouts:checkin_document'], [checkout_document, checkin_document], menu_name="sidebar")
register_top_menu(name='checkouts', link=checkout_list)

APIEndPoint('checkouts')
开发者ID:BangorUniversity,项目名称:mayan-edms,代码行数:30,代码来源:__init__.py


示例20: register_model_list_columns

    link_agency_acl_details,
)
from .models import Agency
from .permissions import PERMISSION_AGENCY_VIEW, PERMISSION_AGENCY_EDIT


Link.bind_links([Agency, "agency_list"], [link_agency_list], menu_name="secondary_menu")
# Link.bind_links([Agency], [link_agency_details, link_agency_view, link_agency_edit, link_agency_delete])
Link.bind_links([Agency], [link_agency_acl_details])  # , link_agency_view, link_agency_edit])#, link_agency_delete])

register_model_list_columns(
    Agency,
    [
        # {'name': _(u'registration'), 'attribute': 'registration'},
        {"name": _(u"name"), "attribute": "name"}
    ],
)

register_top_menu("agencies", link=link_agencies, position=1)

class_permissions(Agency, [PERMISSION_AGENCY_VIEW, PERMISSION_AGENCY_EDIT, ACLS_VIEW_ACL, ACLS_EDIT_ACL])

# agency_search = SearchModel('agencies', 'Agency')

# agency_search.add_model_field('prifas', label=_(u'Prifas number'))
# agency_search.add_model_field('registration', label=_(u'Registration'))
# agency_search.add_model_field('name', label=_(u'Name'))
# agency_search.add_model_field('director', label=_(u'Director'))
# agency_search.add_model_field('physical_address', label=_(u'Physical address'))
# agency_search.add_model_field('postal_address', label=_(u'Postal address'))
开发者ID:giangonz,项目名称:lean,代码行数:30,代码来源:__init__.py



注:本文中的navigation.api.register_top_menu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python navigator_tools.fprint函数代码示例发布时间:2022-05-27
下一篇:
Python api.register_links函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap