row = None
rows = None
if config_id:
row = db(ctable.id == config_id).select(ctable.merge,
limitby= (0, 1)
).first()
if row:
// May well not be complete, so Left Join
left = (ptable.on(ptable.id == ctable.projection_id),
stable.on((stable.config_id == ctable.id) & \
(stable.layer_id == None)),
mtable.on(mtable.id == stable.marker_id),
)
if row.merge:
// Merge this one with the Site Default
query = (ctable.id == config_id) | \
(ctable.uuid == "SITE_DEFAULT")