Exemplo n.º 1
0
plugin_gmaps.set = dblanguage(dblanguage.ALC.id > 0)
plugin_gmaps.alcs = lambda row: '%(ALC)s' % {'ALC': row.ALC_Full_Name}
plugin_gmaps.color = lambda row: '%(COLOR)s' % {'COLOR': row.Colour.lower()}
plugin_gmaps.image = lambda row: '%(IMAGE)s' % {'IMAGE': row.image}
plugin_gmaps.address = lambda row: '%(Address)s' % {
    'Address': row.Postal_Address
}
plugin_gmap.set = dblanguage(
    dblanguage.CLW.id > 0
)  ### change this to a query that lists records with latitude and longitute
plugin_gmap.id = lambda row: '%(id)s' % {'id': row.ALC}
plugin_gmap.alt = lambda row: '%(Alt Name)s' % {'Alt Name': row.Alt_Name}

plugin_gmap.ALC = lambda row: '%(ALC)s' % {
    'ALC': dblanguage.ALC(id='%(id)s' % {
        'id': row.ALC
    }).ALC_Full_Name
}
plugin_gmap.clw = lambda row: '%(CLW)s' % {'CLW': row.CLW}
plugin_gmap.address = lambda row: '%(Address)s' % {
    'Address': row.Postal_Address
}

plugin_gmap.image = lambda row: '%(image)s' % {
    "image": row.image or dblanguage.ALC(id='%(id)s' % {
        'id': row.ALC
    }).image
}
plugin_gmap.represent = lambda row: '%(ALC)s' % {'ALC': row.ALC}
# include plugin in views with {{=LOAD('plugin_gmap')}}