Ejemplo n.º 1
0
def transform(engine):
    countries_func = lambda v, c: country_by_name(v).get('iso2')
    map_names(countries_func, engine, 'representative',
            'contact_country', 'country_code')
    map_names(countries_func, engine, 'country_of_member',
            'country', 'country_code')
    map_names(countries_func, engine, 'expertgroup_member_country',
            'country', 'country_code')

    names_func = lambda v, c: canonical(DATASET, v, context=c)
    map_names(names_func, engine, 'representative')
    #map_names(names_func, engine, 'person')
    map_names(names_func, engine, 'financial_data_turnover')
    map_names(names_func, engine, 'organisation')
    map_names(names_func, engine, 'network_entity')
    map_names(names_func, engine, 'expertgroup_member')
Ejemplo n.º 2
0
def transform(engine):
    countries_func = lambda v, c: country_by_name(v).get('iso2')
    map_names(countries_func, engine, 'contact',
            'country', 'country_code')
    map_names(countries_func, engine, 'country_of_member',
            'country', 'country_code')
    map_names(countries_func, engine, 'expertgroup_member_country',
            'country', 'country_code')

    def names_func(v, c, **kw):
        canonical(DATASET, v, context=c, **kw)
    map_names(names_func, engine, 'representative')
    #map_names(names_func, engine, 'person')
    map_names(names_func, engine, 'financial_data_turnover')
    map_names(names_func, engine, 'organisation', readonly=True)
    map_names(names_func, engine, 'network_entity', readonly=True)
    map_names(names_func, engine, 'expertgroup_member', readonly=True)
    map_names(names_func, engine, 'meeting', 'representative', filt={'identification_code': 'unregistered'})