1 from django
.core
.management
.base
import BaseCommand
2 from mygpo
.search
.models
import SearchEntry
3 from mygpo
.api
.models
import ToplistEntry
5 class Command(BaseCommand
):
7 def handle(self
, *args
, **options
):
9 SearchEntry
.objects
.all().delete()
11 toplist
= ToplistEntry
.objects
.all()
15 entry
= SearchEntry
.from_object(e
.podcast_group
, e
.subscriptions
)
18 entry
= SearchEntry
.from_object(e
.podcast
, e
.subscriptions
)
20 if entry
and entry
.text
: