1. albertoconnor
  2. django-mailman

Commits

rodolphe  committed d8108f8

Add list_lists in management commands

  • Participants
  • Parent commits f28d01c
  • Branches default

Comments (0)

Files changed (3)

File django_mailman/management/__init__.py

  • Ignore whitespace
Empty file added.

File django_mailman/management/commands/__init__.py

  • Ignore whitespace
Empty file added.

File django_mailman/management/commands/list_lists.py

View file
  • Ignore whitespace
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2013 Rodolphe Quiédeville <rodolphe@quiedeville.org>
+#
+"""
+List all lists
+"""
+from django.core.management.base import BaseCommand
+from django_mailman.models import List
+
+
+class Command(BaseCommand):
+    help = 'List all lists with their url on stdout'
+
+    def handle(self, *args, **options):
+        """
+        Handle the command
+        """
+        for olist in List.objects.all():
+            self.stdout.write("%s - %s\n" % (olist.name,
+                                             olist.main_url))