1 from django
.db
.models
import Count
2 from mygpo
.api
.models
import Subscription
, Podcast
3 from mygpo
.data
.models
import PodcastTag
5 def tag_string(tags
, max_length
=200):
7 returns a string of the most-assigned tags
9 tags is expected to be a PodcastTag QuerySet
11 tags
= PodcastTag
.objects
.top_tags(tags
)
12 return ','.join([t
['tag'] for t
in tags
])[:max_length
]