예제 #1
0
def add_cea(row):
    ign = row.get('ID_ADR')
    laposte = row.get('HEXACLE_1')
    if laposte == 'NR':
        return report('Missing CEA', ign, report.ERROR)
    query = HouseNumber.update(laposte=laposte).where(HouseNumber.ign == ign)
    done = query.execute()
    if not done:
        return report('IGN id not found', ign, report.ERROR)
    report('Done', ign, report.NOTICE)
예제 #2
0
파일: oldban.py 프로젝트: fred-V13/ban
def add_cea(row):
    ign = row.get('ID_ADR')
    laposte = row.get('HEXACLE_1')
    if laposte == 'NR':
        return report('Missing CEA', ign, report.ERROR)
    query = HouseNumber.update(laposte=laposte).where(HouseNumber.ign == ign)
    try:
        done = query.execute()
    except peewee.IntegrityError:
        report('Duplicate CEA', laposte, report.ERROR)
    else:
        if not done:
            return report('IGN id not found', ign, report.ERROR)
        report('Done', ign, report.NOTICE)