fcd3511642699009df9a690f684386b94d4543f3
[mygpo.git] / mygpo / data / management / commands / historic-data.py
blobfcd3511642699009df9a690f684386b94d4543f3
1 from django.core.management.base import BaseCommand
2 from mygpo.data.historic import calc_podcast
3 from mygpo.api.models import Podcast, Episode
5 class Command(BaseCommand):
6 def handle(self, *args, **options):
7 max = Podcast.objects.count()
8 n=0
10 for p in Podcast.objects.all().order_by('id').iterator():
11 n+=1
12 print '%d / %d: %d - %s' % (n, max, p.id, p)
13 calc_podcast(p)