<commit_before># coding: utf-8

from __future__ import unicode_literals
from datetime import date
from django.db.models import get_model, Q
from django.http import Http404
from django.shortcuts import redirect
from django.views.generic import ListView, DetailView
from endless_pagination.views import AjaxListView
from django_tables2 import SingleTableMixin
from haystack.query import SearchQuerySet
from viewsets import ModelViewSet
from .models import *
from .forms import *
from .tables import OeuvreTable, IndividuTable, ProfessionTable, PartieTable


__all__ = (b'PublishedDetailView', 'PublishedListView',
           b'EvenementListView', b'EvenementDetailView',
           b'SourceViewSet', b'PartieViewSet', b'ProfessionViewSet',
           b'LieuViewSet', b'IndividuViewSet', b'OeuvreViewSet')


class PublishedDetailView(DetailView):
    def get_queryset(self):
        return super(PublishedDetailView, self).get_queryset().published(
            request=self.request)


class PublishedListView(ListView):
    def get_queryset(self):
        return super(PublishedListView, self).get_queryset().published(
            request=self.request).order_by(*self.model._meta.ordering)


def cleaned_querydict(qd):
    new_qd = qd.copy()
    for k, v in new_qd.items():<commit_msg>Utilise la classe de base des polymorphes pour calculer les vues de détail.<commit_after># coding: utf-8

from __future__ import unicode_literals
from datetime import date
from django.db.models import get_model, Q
from django.http import Http404
from django.shortcuts import redirect
from django.views.generic import ListView, DetailView
from endless_pagination.views import AjaxListView
from django_tables2 import SingleTableMixin
from haystack.query import SearchQuerySet
from polymorphic import PolymorphicQuerySet
from viewsets import ModelViewSet
from .models import *
from .forms import *
from .tables import OeuvreTable, IndividuTable, ProfessionTable, PartieTable


__all__ = (b'PublishedDetailView', 'PublishedListView',
           b'EvenementListView', b'EvenementDetailView',
           b'SourceViewSet', b'PartieViewSet', b'ProfessionViewSet',
           b'LieuViewSet', b'IndividuViewSet', b'OeuvreViewSet')


class PublishedDetailView(DetailView):
    def get_queryset(self):
        qs = super(PublishedDetailView, self).get_queryset()
        if isinstance(qs, PolymorphicQuerySet):
            qs = qs.non_polymorphic()
        return qs.published(request=self.request)


class PublishedListView(ListView):
    def get_queryset(self):
        return super(PublishedListView, self).get_queryset().published(
            request=self.request).order_by(*self.model._meta.ordering)


def cleaned_querydict(qd):
    new_qd = qd.copy()
    for k, v in new_qd.items():
{'fraction_non_alphanumeric': 0.08257877580586744, 'fraction_numerical': 0.003621876131836291, 'mean_word_length': 4.742203742203742, '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': '760627', 'n_tokens_mistral': 840, 'n_tokens_neox': 787, 'n_words': 209}