

def building_marker_fn(record):
    '\n        Function to decide which Marker to use for Building Assessments Map\n        @ToDo: Legend\n        @ToDo: Move to Templates\n    '
    if (record.asbestos == 1):
        marker = 'hazmat'
    else:
        marker = 'residence'
    priority = record.priority
    if (priority == 1):
        marker = ('%s_red' % marker)
    elif (priority == 2):
        marker = ('%s_yellow' % marker)
    elif (priority == 3):
        marker = ('%s_green' % marker)
    mtable = db.gis_marker
    try:
        marker = db((mtable.name == marker)).select(mtable.image, mtable.height, mtable.width, cache=s3db.cache, limitby=(0, 1)).first()
    except:
        marker = db((mtable.name == 'residence')).select(mtable.image, mtable.height, mtable.width, cache=s3db.cache, limitby=(0, 1)).first()
    return marker

dataset/ETHPy150Open sahana/eden/controllers/assess.py building_marker_fn/original