Example #1
0
    def get(self, request, username):

        User = get_user_model()
        user = User.objects.get(username=username)
        month_ago = datetime.today() - timedelta(days=31)
        site = RequestSite(request)

        context = {
            "page_user": user,
            "site": site.domain,
            "subscriptions_token":
            user.profile.get_token("subscriptions_token"),
            "favorite_feeds_token":
            user.profile.get_token("favorite_feeds_token"),
            "lists": self.get_podcast_lists(user),
            "subscriptions": self.get_subscriptions(user),
            "recent_episodes": last_played_episodes(user),
            "seconds_played_total": seconds_played(user),
            "seconds_played_month": seconds_played(user, month_ago),
            "favorite_episodes": FavoriteEpisode.episodes_for_user(user),
            "num_played_episodes_total": num_played_episodes(user),
            "num_played_episodes_month": num_played_episodes(user, month_ago),
        }

        return render(request, "userpage.html", context)
Example #2
0
    def get(self, request, username):

        User = get_user_model()
        user = User.objects.get(username=username)
        month_ago = datetime.today() - timedelta(days=31)
        site = RequestSite(request)

        context = {
            'page_user': user,
            'flattr_username':
            user.profile.settings.get_wksetting(FLATTR_USERNAME),
            'site': site.domain,
            'subscriptions_token':
            user.profile.get_token('subscriptions_token'),
            'favorite_feeds_token':
            user.profile.get_token('favorite_feeds_token'),
            'lists': self.get_podcast_lists(user),
            'subscriptions': self.get_subscriptions(user),
            'recent_episodes': last_played_episodes(user),
            'seconds_played_total': seconds_played(user),
            'seconds_played_month': seconds_played(user, month_ago),
            'favorite_episodes': FavoriteEpisode.episodes_for_user(user),
            'num_played_episodes_total': num_played_episodes(user),
            'num_played_episodes_month': num_played_episodes(user, month_ago),
        }

        return render(request, 'userpage.html', context)
Example #3
0
    def get(self, request, username):

        User = get_user_model()
        user = User.objects.get(username=username)
        month_ago = datetime.today() - timedelta(days=31)
        site = RequestSite(request)

        context = {
            'page_user': user,
            'site': site.domain,
            'subscriptions_token': user.profile.get_token('subscriptions_token'),
            'favorite_feeds_token': user.profile.get_token('favorite_feeds_token'),
            'lists': self.get_podcast_lists(user),
            'subscriptions': self.get_subscriptions(user),
            'recent_episodes': last_played_episodes(user),
            'seconds_played_total': seconds_played(user),
            'seconds_played_month': seconds_played(user, month_ago),
            'favorite_episodes': FavoriteEpisode.episodes_for_user(user),
            'num_played_episodes_total': num_played_episodes(user),
            'num_played_episodes_month': num_played_episodes(user, month_ago),
        }

        return render(request, 'userpage.html', context)