<commit_before># -*- coding: utf-8 -*-

from django.core.management.base import BaseCommand
from borme.models import Config

from libreborme.utils import get_git_revision_short_hash


class Command(BaseCommand):
    help = 'Update current Git version hash'

    def handle(self, *args, **options):
        config = Config.objects.first()
        version = get_git_revision_short_hash()
        print(version)
        if config:
            config.version = version
        else:
            config = Config(version=version)
        config.save()<commit_msg>updateversion: insertar fecha last_modified también<commit_after># -*- coding: utf-8 -*-

from django.core.management.base import BaseCommand
from django.utils import timezone

from borme.models import Config

from libreborme.utils import get_git_revision_short_hash


class Command(BaseCommand):
    help = 'Update current Git version hash'

    def handle(self, *args, **options):
        config = Config.objects.first()
        version = get_git_revision_short_hash()
        print(version)
        if config:
            config.version = version
        else:
            date = timezone.make_aware(timezone.datetime(2000, 1, 1))
            config = Config(version=version, last_modified=date)
        config.save()
{'fraction_non_alphanumeric': 0.09162098668754894, 'fraction_numerical': 0.006264682850430697, 'mean_word_length': 2.9813084112149535, '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': '5036743', 'n_tokens_mistral': 363, 'n_tokens_neox': 353, 'n_words': 92}