much more pep8
[mygpo.git] / mygpo / data / management / commands / group-podcasts.py
blob974beb701547ad0df8e03ee4c88d575f80cbccdc
1 from django.core.management.base import BaseCommand
3 from mygpo.core.models import Podcast
4 from mygpo.db.couchdb.podcast import podcast_for_url
7 class Command(BaseCommand):
8 def handle(self, *args, **options):
10 if len(args) != 5:
11 print 'Usage: ./manage.py group-podcasts <url1> <url2> <group-name> <name1> <name2>'
12 return
14 p1_url = args[0]
15 p2_url = args[1]
16 group_title = args[2]
17 myname = args[3]
18 othername = args[4]
20 p1 = podcast_for_url(p1_url)
21 p2 = podcast_for_url(p2_url)
23 p1.group_with(p2, group_title, myname, othername)