Ejemplo n.º 1
0
def apply_normalizers(results):
    '''build the appropriate normalizers for the query set(s) and annotate'''
    normalized = []
    mapping = [
        ('maps', MapNormalizer),
        ('layers', LayerNormalizer),
        ('documents', DocumentNormalizer),
        ('users', OwnerNormalizer),
    ]
    for k,n in mapping:
        r = results.get(k, None)
        if not r: continue
        normalizers = map(n, r)
        _annotate(normalizers)
        extension.process_results(normalizers)
        normalized.extend(normalizers)
    return normalized
Ejemplo n.º 2
0
def apply_normalizers(results):
    '''build the appropriate normalizers for the query set(s) and annotate'''
    normalized = []

    mapping = [('maps', MapNormalizer), ('layers', LayerNormalizer),
               ('documents', DocumentNormalizer), ('users', OwnerNormalizer)]
    if "geonode.contrib.groups" in settings.INSTALLED_APPS:
        mapping.append(('groups', GroupNormalizer))

    for k, n in mapping:
        r = results.get(k, None)
        if not r: continue
        normalizers = map(n, r)
        _annotate(normalizers)
        extension.process_results(normalizers)
        normalized.extend(normalizers)
    return normalized
Ejemplo n.º 3
0
def apply_normalizers(results):
    '''build the appropriate normalizers for the query set(s) and annotate'''
    normalized = []
    mapping = [
        ('maps', MapNormalizer),
        ('layers', LayerNormalizer),
        ('documents', DocumentNormalizer),
        ('owners', OwnerNormalizer),
    ]
    for k, n in mapping:
        r = results.get(k, None)
        if not r: continue
        normalizers = map(n, r)
        _annotate(normalizers)
        extension.process_results(normalizers)
        normalized.extend(normalizers)
    return normalized
Ejemplo n.º 4
0
def apply_normalizers(results):
    '''build the appropriate normalizers for the query set(s) and annotate'''
    normalized = []

    mapping = [
        ('maps', MapNormalizer),
        ('layers', LayerNormalizer),
        ('documents', DocumentNormalizer),
        ('users', OwnerNormalizer)
    ]
    if "geonode.contrib.groups" in settings.INSTALLED_APPS:
        mapping.append(('groups', GroupNormalizer))

    for k,n in mapping:
        r = results.get(k, None)
        if not r: continue
        normalizers = map(n, r)
        _annotate(normalizers)
        extension.process_results(normalizers)
        normalized.extend(normalizers)
    return normalized