def set_priority_js():
 wptable = s3db.cap_warning_priority
 rows = db(wptable).select(wptable.name, wptable.urgency, wptable.severity, wptable.certainty, wptable.color_code, orderby=wptable.name)
 from gluon.serializers import json as jsons
 from s3 import s3_str
 p_settings = [(s3_str(T(r.name)), r.urgency, r.severity, r.certainty, r.color_code) for r in rows]
 priority_conf = s3_str(('S3.cap_priorities=%s' % jsons(p_settings)))
 js_global = s3.js_global
 if (not (priority_conf in js_global)):
  js_global.append(priority_conf)
 return

def set_priority_js ( ) : wptable = s3db . cap_warning_priority rows = db ( wptable ) . select ( wptable . name , wptable . urgency , wptable . severity , wptable . certainty , wptable . color_code , orderby = wptable . name ) from gluon . serializers import json as jsons from s3 import s3_str p_settings = [ ( s3_str ( T ( r . name ) ) , r . urgency , r . severity , r . certainty , r . color_code ) for r in rows ] priority_conf = s3_str ( ( 'S3.cap_priorities=%s' % jsons ( p_settings ) ) ) js_global = s3 . js_global if ( not ( priority_conf in js_global ) ) : js_global . append ( priority_conf ) return
output json for priority field .