remove unnecessary imports
[mygpo.git] / mygpo / data / management / commands / group-podcasts.py
blobfb5fee6f4e411b73b4a99be1d148c84270b3823d
1 from django.core.management.base import BaseCommand
2 from mygpo.api.models import Podcast
4 class Command(BaseCommand):
5 def handle(self, *args, **options):
7 if len(args) != 5:
8 print 'Usage: ./manage.py group-podcasts <url1> <url2> <group-name> <name1> <name2>'
9 return
11 p1_url = args[0]
12 p2_url = args[1]
13 group_title = args[2]
14 myname = args[3]
15 othername = args[4]
17 p1 = Podcast.objects.get(url=p1_url)
18 p2 = Podcast.objects.get(url=p2_url)
20 p1.group_with(p2, group_title, myname, othername)