def enter_filing(data_hash):

    filing_created=False
    related_committee = None
    
    try:
        thisobj = new_filing.objects.get(filing_number=data_hash['filing_number'])
        try:
            thisobj.filed_date
        except AttributeError:
            
            try:
                thisobj.filed_date = get_local_time(data_hash['filed_date'])
                thisobj.process_time = get_local_time(data_hash['filed_date'])
                thisobj.save()
            except pytz.exceptions.AmbiguousTimeError:
                thisobj.filed_date = data_hash['filed_date']
                thisobj.process_time = data_hash['filed_date']
                thisobj.save()
                
        
        
    except new_filing.DoesNotExist:
        print "entering %s %s" % (data_hash['filing_number'], data_hash['committee_id'])
        is_superpac=False
        
        try:
            thisobj = new_filing.objects.create(
                is_superpac = is_superpac,
                #related_committee = related_committee,
                fec_id = data_hash['committee_id'],
                committee_name = data_hash['committee_name'],
                filing_number = data_hash['filing_number'],
                form_type = data_hash['form_type'],
                filed_date = get_local_time(data_hash['filed_date']),
                process_time = get_local_time(data_hash['filed_date']),
            )
        except pytz.exceptions.AmbiguousTimeError:
            thisobj = new_filing.objects.create(
                is_superpac = is_superpac,
                #related_committee = related_committee,
                fec_id = data_hash['committee_id'],
                committee_name = data_hash['committee_name'],
                filing_number = data_hash['filing_number'],
                form_type = data_hash['form_type'],
                filed_date = data_hash['filed_date'],
                process_time = data_hash['filed_date'],
            )
        
        filing_created=True
        needs_saving=False
        try:
            thisobj.coverage_from_date = data_hash['coverage_from_date']
            thisobj.cycle = get_cycle_from_date(data_hash['coverage_from_date'])
            needs_saving=True
        except __HOLE__:
            pass
        try:
            thisobj.coverage_to_date = data_hash['coverage_to_date']
            needs_saving=True
        except KeyError:
            pass
        
        
        
        if needs_saving:
            thisobj.save()
    
    # return true if a new filing was created
    return filing_created
dataset/ETHPy150Open sunlightlabs/read_FEC/fecreader/fec_alerts/management/commands/scrape_rss_filings.py/enter_filing