Did I find the right examples for you? yes no

All Samples(5)  |  Call(2)  |  Derive(0)  |  Import(3)

        def sync_plugins_action(name):
    @transaction.atomic
    def sync_plugins(modeladmin, request, queryset):
        content = StringIO()
        call_command('sync%s' % name, stdout=content)
        content.seek(0)
        found = [ line.split(' ')[1] for line in content.read().splitlines() ]
        msg = '%i %s have been found (%s).' % (len(found), name, ', '.join(found))
        modeladmin.message_user(request, msg)
    sync_plugins.description = "Syncronize existing %s with the database." % name
    sync_plugins.url_name = 'sync-plugins'
    sync_plugins.verbose_name = 'Sync plugins'
    return sync_plugins
        


src/c/o/confine-controller-0.10.5/controller/apps/notifications/actions.py   confine-controller(Download)
from django.db import transaction
 
from controller.utils.plugins.actions import sync_plugins_action
 
from .tasks import notify
 
 
sync_notifications = sync_plugins_action('notifications')
 
 

src/c/o/confine-controller-0.10.5/controller/apps/firmware/actions.py   confine-controller(Download)
from django.utils.translation import ugettext_lazy
 
from controller.utils.plugins.actions import sync_plugins_action
 
from .forms import BaseImageForm, OptionalFilesForm
 
 
sync_plugins = sync_plugins_action('firmwareplugins')
sync_plugins.verbose_name = 'Sync plugins'
 

src/c/o/confine-controller-0.10.5/controller/apps/notifications/admin.py   confine-controller(Download)
from controller.admin import ChangeViewActions
from controller.admin.utils import wrap_admin_view
from controller.utils.plugins.actions import sync_plugins_action
 
from .actions import (enable_selected, disable_selected, run_notifications,