def get_actions_urls(model, url_name=None, **kwargs):
    """
    Get automatically the actions urls for a model.

    """
    from ionyweb.administration.actions.views import (ActionAdminListView,
                                                      ActionAdminDetailView,
                                                      ActionAdminOrderView)

    app_label = model._meta.app_label
    # Url Name
    if url_name is None:
        module_name = model._meta.module_name
    else:
        module_name = url_name

    # Specific Detail View
    try:
        DetailView = kwargs.pop('detail_view_class')
    except KeyError:
        DetailView = ActionAdminDetailView
    # Specific List View
    try:
        ListView = kwargs.pop('list_view_class')
    except __HOLE__:
        ListView = ActionAdminListView
    # Prefix URL
    try:
        prefix_url = kwargs.pop('prefix_url')
    except KeyError:
        prefix_url = ''

    # Args Management
    def filter_kwargs(exclude_args, kwargs):
        new_kwargs = kwargs.copy()
        for arg in exclude_args:
            if arg in new_kwargs:
                del new_kwargs[arg]
        return new_kwargs

    list_kwargs = filter_kwargs(['form_class'], kwargs)
    detail_kwargs = filter_kwargs(['ordering', 'sortable', 'sortable_field', 'list_display'], kwargs)

    urlpatterns = patterns('',
                           # Change List Action
                           url(r'^%s%s_list/$' % (prefix_url, module_name),
                               ListView.as_view(model=model, **list_kwargs),
                               name='wa-%s-%s_list-action' % (app_label, module_name)),
                           
                           # Object Detail Action
                           url(r'^%s%s/(?P<object_pk>[0-9]*)/$' % (prefix_url, module_name),
                               DetailView.as_view(model=model, **detail_kwargs),
                               name='wa-%s-%s-action' % (app_label, module_name)),

                           # Object Creation Action
                           url(r'^%s%s/$' % (prefix_url, module_name),
                               DetailView.as_view(model=model, **detail_kwargs),
                               name='wa-%s-%s-creation-action' % (app_label, module_name)),
                           )
    if kwargs.get('sortable', False):
        urlpatterns += patterns('',
                                url(r'^%s%s_order/$' % (prefix_url, module_name),
                                    ActionAdminOrderView.as_view(model=model),
                                    name='wa-%s-%s_order-action' % (app_label, module_name)),
                                )
    return urlpatterns
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/administration/actions/utils.py/get_actions_urls