1 from django
.core
.urlresolvers
import reverse
3 from mygpo
.db
.couchdb
.episode
import favorite_episodes_for_user
9 def __init__(self
, user
):
13 return '%s\'s Favorite Episodes' % self
.user
.username
15 def get_episodes(self
):
16 return favorite_episodes_for_user(self
.user
)
20 If all of the feed's episodes have the same language, return it,
21 otherwise return an empty string
23 l
= list(set([x
.language
for x
in self
.get_episodes() if x
.language
]))
29 def get_public_url(self
, domain
):
30 return 'http://%s%s' % (domain
, reverse('favorites-feed', args
=[self
.user
.username
]))