1 from django
.core
.management
.base
import BaseCommand
2 from mygpo
.api
.models
import Podcast
3 from django
.contrib
.auth
.models
import User
4 from mygpo
.publisher
.models
import PodcastPublisher
6 class Command(BaseCommand
):
7 def handle(self
, *args
, **options
):
12 user
= User
.objects
.get(username
=username
)
13 podcast
= Podcast
.objects
.get(url
=podcast_url
)
15 PodcastPublisher
.objects
.create(user
=user
, podcast
=podcast
)