def get_random_list(self, podcasts_per_list=5): random_list = next(random_podcastlists(), None) list_owner = None if random_list: random_list = proxy_object(random_list) random_list.more_podcasts = max(0, len(random_list.podcasts) - podcasts_per_list) random_list.podcasts = podcasts_by_id(random_list.podcasts[:podcasts_per_list]) random_list.user = get_user_by_id(random_list.user) yield random_list
def _prepare_list(l): user = get_user_by_id(l.user) l = proxy_object(l) l.username = user.username if user else '' return l