<commit_before># (c) Crown Owned Copyright, 2016. Dstl.
# apps/teams/views.py
from django.views.generic import CreateView, DetailView, ListView
from django.views.generic.base import TemplateView
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.db import IntegrityError

from .models import Team
from apps.organisations.models import Organisation
from .forms import TeamForm
from apps.organisations.models import Organisation


class TeamList(ListView):
    model = Team

    #   We're also going to jam the for on the list view page.
    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()

        return context


class TeamCreate(CreateView):
    model = Team
    form_class = TeamForm
<commit_msg>We ended up with a duplicate import, begone!!<commit_after># (c) Crown Owned Copyright, 2016. Dstl.
# apps/teams/views.py
from django.views.generic import CreateView, DetailView, ListView
from django.views.generic.base import TemplateView
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.db import IntegrityError

from .models import Team
from apps.organisations.models import Organisation
from .forms import TeamForm


class TeamList(ListView):
    model = Team

    #   We're also going to jam the for on the list view page.
    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()

        return context


class TeamCreate(CreateView):
    model = Team
    form_class = TeamForm

{'fraction_non_alphanumeric': 0.08241469816272966, 'fraction_numerical': 0.004199475065616798, 'mean_word_length': 4.123655913978495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '765081', 'n_tokens_mistral': 561, 'n_tokens_neox': 524, 'n_words': 167}