<commit_before>from django.core.management.base import BaseCommand, CommandError

from formdata.models import SkedE
from summary_data.models import Committee_Overlay


def attach_committee_to_skedeline(skedeline):
    try:
        co = Committee_Overlay.objects.get(fec_id=skedeline.filer_committee_id_number)
        skedeline.committee_name = co.name
        skedeline.committee_slug = co.slug
        skedeline.save()
        
    except Committee_Overlay.DoesNotExist:
        print "Missing committee overlay for %s" % (skedeline.filer_committee_id_number)
        
class Command(BaseCommand):
    help = "Set the name and details of the committee making the ie"
    requires_model_validation = False
    

    def handle(self, *args, **options):
        skedelines = SkedE.objects.filter(committee_slug__isnull=True).order_by('filing_number')
        for this_line in skedelines:
            attach_committee_to_skedeline(this_line)<commit_msg>change back--this is not really tractable<commit_after>from django.core.management.base import BaseCommand, CommandError

from formdata.models import SkedE
from summary_data.models import Committee_Overlay


def attach_committee_to_skedeline(skedeline):
    try:
        co = Committee_Overlay.objects.get(fec_id=skedeline.filer_committee_id_number)
        skedeline.committee_name = co.name
        skedeline.committee_slug = co.slug
        skedeline.save()
        
    except Committee_Overlay.DoesNotExist:
        print "Missing committee overlay for %s" % (skedeline.filer_committee_id_number)
        
class Command(BaseCommand):
    help = "Set the name and details of the committee making the ie"
    requires_model_validation = False
    

    def handle(self, *args, **options):
        skedelines = SkedE.objects.filter(committee_name__isnull=True).order_by('filing_number')
        for this_line in skedelines:
            attach_committee_to_skedeline(this_line)
{'fraction_non_alphanumeric': 0.07053941908713693, 'fraction_numerical': 0.0, 'mean_word_length': 3.7747524752475248, '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': '3750359', 'n_tokens_mistral': 581, 'n_tokens_neox': 574, 'n_words': 122}