<commit_before># -*- coding: utf-8 -*-
"""les vues qui sont implementés ici
option_index: vue qui gere l'index de toutes les options possible accesibles vie le menu option
gestion_echeances:vue qui gere les echeances
"""

from __future__ import absolute_import
from django.template import RequestContext
from django.conf import settings
from django.shortcuts import render_to_response
from django.contrib import messages
from .views import Mytemplateview
from .models import Compte, Cat, Tiers, Moyen, Echeance


def gestion_echeances(request):
    """vue qui gere les echeances"""
    Echeance.check(request)
    return render_to_response('gsb/options.djhtm', {'titre': u'integration des échéances échues', },
                              context_instance=RequestContext(request))


def verif_element_config(element, request, collection=None):
    id_elem = getattr(settings, element, None)
    if id_elem is None:
        messages.error(request, "%s non definit dans setting.py" % element)
    if collection is not None:
        objet = collection.objects.filter(id=id_elem)
        if not objet.exists():
            messages.error(request, u"%s n'existe pas" % element)


def verif_config(request):
    verif_element_config("ID_CPT_M", request, Compte)
    verif_element_config("TAUX_VERSEMENT", request)
    verif_element_config("ID_CAT_COTISATION", request, Cat)
    verif_element_config("ID_CAT_OST", request, Cat)
    verif_element_config("ID_CAT_PMV", request, Cat)
    verif_element_config("ID_TIERS_COTISATION", request, Tiers)
    verif_element_config("MD_CREDIT", request, Moyen)
    verif_element_config("MD_DEBIT", request, Moyen)
    verif_element_config("TITRE", request)
    verif_element_config("DEVISE_GENERALE", request)
    verif_element_config("TAUX_VERSEMENT", request)
    verif_element_config("AFFICHE_CLOT", request)
    verif_element_config("UTILISE_EXERCICES", request)

    return render_to_response(
        'generic.djhtm',
        {'resultats': (u"vous trouverez les résultats de la verification de la config",),
         'titre_long': "verif config",
         'titre': "verif _config",<commit_msg>ajout verif et import des trucs par defaut<commit_after># -*- coding: utf-8 -*-
"""les vues qui sont implementés ici
option_index: vue qui gere l'index de toutes les options possible accesibles vie le menu option
gestion_echeances:vue qui gere les echeances
"""

from __future__ import absolute_import
from django.template import RequestContext
from django.conf import settings
from django.shortcuts import render_to_response
from django.contrib import messages
from .views import Mytemplateview
from .models import Compte, Cat, Tiers, Moyen, Echeance
from .io import import_base


def gestion_echeances(request):
    """vue qui gere les echeances"""
    Echeance.check(request)
    return render_to_response('gsb/options.djhtm', {'titre': u'integration des échéances échues', },
                              context_instance=RequestContext(request))


def verif_element_config(element, request, collection=None):
    id_elem = getattr(settings, element, None)
    if id_elem is None:
        messages.error(request, "%s non definit dans setting.py" % element)
    if collection is not None:
        objet = collection.objects.filter(id=id_elem)
        if not objet.exists():
            messages.error(request, u"%s n'existe pas" % element)


def verif_config(request):
    moyens = import_base.Moyen_cache(request)
    import_base.Cat_cache(request)
    import_base.IB_cache(request)
    import_base.Compte_cache(request)
    import_base.Banque_cache(request)
    import_base.Exercice_cache(request)
    import_base.Tiers_cache(request)
    import_base.Ope_cache(request)
    titres = import_base.Titre_cache(request)
    import_base.Cours_cache(request, titres)
    import_base.moyen_defaut_cache(request, moyens)
    import_base.Rapp_cache(request)
    verif_element_config("ID_CPT_M", request, Compte)
    verif_element_config("TAUX_VERSEMENT", request)
    verif_element_config("ID_CAT_COTISATION", request, Cat)
    verif_element_config("ID_CAT_OST", request, Cat)
    verif_element_config("ID_CAT_PMV", request, Cat)
    verif_element_config("ID_TIERS_COTISATION", request, Tiers)
    verif_element_config("MD_CREDIT", request, Moyen)
    verif_element_config("MD_DEBIT", request, Moyen)
    verif_element_config("TITRE", request)
    verif_element_config("DEVISE_GENERALE", request)
    verif_element_config("TAUX_VERSEMENT", request)
    verif_element_config("AFFICHE_CLOT", request)
    verif_element_config("UTILISE_EXERCICES", request)
    return render_to_response(
        'generic.djhtm',
        {'resultats': (u"vous trouverez les résultats de la verification de la config",),
         'titre_long': "verif config",
         'titre': "verif _config",
{'fraction_non_alphanumeric': 0.09391920033319451, 'fraction_numerical': 0.00041649312786339027, 'mean_word_length': 4.624121779859485, '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': '3655170', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1531, 'n_words': 358}