Пример #1
0
    def get_context_data(self, **kwargs):
        context = super(TeamList, self).get_context_data(**kwargs)
        context['form'] = TeamForm

        context['top_teams'] = Team.with_most_members()
        context['top_organisations'] = Organisation.with_most_teams()
        context['total_teams_in_db'] = Team.objects.count()

        return context
Пример #2
0
    def get_context_data(self, **kwargs):
        context = super(UserList, self).get_context_data(**kwargs)

        context["top_teams"] = Team.with_most_members()
        context["top_organisations"] = Organisation.with_most_teams()
        context["total_users_in_db"] = User.objects.count()

        if self.has_query():
            context["query"] = self.request.GET["q"]
            context["results_length"] = len(context["object_list"])

        return context
Пример #3
0
    def get_context_data(self, **kwargs):
        context = super(UserList, self).get_context_data(**kwargs)

        context['top_teams'] = Team.with_most_members()
        context['top_organisations'] = Organisation.with_most_teams()
        context['total_users_in_db'] = User.objects.count()

        if self.has_query():
            context['query'] = self.request.GET['q']
            context['results_length'] = len(context['object_list'])

        return context