1 from optparse
import make_option
3 from django
.core
.management
.base
import BaseCommand
5 from mygpo
.podcasts
.models
import Podcast
6 from mygpo
.utils
import progress
7 from mygpo
.directory
.tasks
import update_podcast_subscribers
10 class Command(BaseCommand
):
11 """For each podcast a task is scheduled to update its subscriber count"""
13 def add_arguments(self
, parser
):
19 help="Don't show any output",
22 def handle(self
, *args
, **options
):
24 silent
= options
.get("silent")
26 podcasts
= Podcast
.objects
.all()
27 total
= podcasts
.count()
29 for n
, podcast
in enumerate(podcasts
):
30 update_podcast_subscribers
.delay(podcast
.get_id())