def cap_alert_is_template(alert_id):
 if (not alert_id):
  return False
 table = current.s3db.cap_alert
 query = (table.id == alert_id)
 r = current.db(query).select(table.is_template, limitby=(0, 1)).first()
 return (r and r.is_template)

def cap_alert_is_template ( alert_id ) : if ( not alert_id ) : return False table = current . s3db . cap_alert query = ( table . id == alert_id ) r = current . db ( query ) . select ( table . is_template , limitby = ( 0 , 1 ) ) . first ( ) return ( r and r . is_template )
tell whether an alert entry is a template .