def handle_label(self, label, **options):
plugin_pool.get_all_plugins()
queryset = CMSPlugin.objects.filter(plugin_type=label)
number_of_plugins = queryset.count()
if number_of_plugins > 0:
if options.get('interactive'):
confirm = input("""
You have requested to remove %d %r plugins.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: """ % (number_of_plugins, label))
else:
confirm = 'yes'
if confirm == 'yes':
queryset.delete()
self.stdout.write('%d %r plugins uninstalled\n' % (number_of_plugins, label))
else:
self.stdout.write('Aborted')
else:
self.stdout.write('no %r plugins found\n' % label)
评论列表
文章目录