<commit_before>from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings

from foiidea.models import Article


class Command(BaseCommand):
    help = "Recalculate Article Order"

    def handle(self, **options):
        translation.activate(settings.LANGUAGE_CODE)
        Article.objects.recalculate_order()<commit_msg>Import Model late in management command<commit_after>from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings


class Command(BaseCommand):
    help = "Recalculate Article Order"

    def handle(self, **options):
        translation.activate(settings.LANGUAGE_CODE)
        from foiidea.models import Article
        Article.objects.recalculate_order()
{'fraction_non_alphanumeric': 0.07240948813982521, 'fraction_numerical': 0.0, 'mean_word_length': 4.608391608391608, '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': '3953735', 'n_tokens_mistral': 204, 'n_tokens_neox': 199, 'n_words': 58}