def question():
 def prep(r):
  record = r.record
  if (record and (r.component_name == 'question_l10n')):
   ttable = r.component.table
   if (r.method != 'update'):
    ttable.question.default = record.question
    ttable.options.default = record.options
   requires = ttable.language.requires
   if isinstance(requires, IS_ISO639_2_LANGUAGE_CODE):
    all_options = dict(requires.language_codes())
    selectable = requires._select
    if (not selectable):
     selectable = all_options
    selectable = dict(selectable)
    query = ((ttable.question_id == r.id) & (ttable.deleted != True))
    if r.component_id:
     query &= (ttable.id != r.component_id)
    rows = db(query).select(ttable.language)
    for row in rows:
     selectable.pop(row.language, None)
    if ((len(selectable) == 0) or (not any(((opt in all_options) for opt in selectable)))):
     r.component.configure(insertable=False)
    requires._select = selectable
  return True
 s3.prep = prep
 return s3_rest_controller(rheader=s3db.dc_rheader)

def question ( ) : def prep ( r ) : record = r . record if ( record and ( r . component_name == 'question_l10n' ) ) : ttable = r . component . table if ( r . method != 'update' ) : ttable . question . default = record . question ttable . options . default = record . options requires = ttable . language . requires if isinstance ( requires , IS_ISO639_2_LANGUAGE_CODE ) : all_options = dict ( requires . language_codes ( ) ) selectable = requires . _select if ( not selectable ) : selectable = all_options selectable = dict ( selectable ) query = ( ( ttable . question_id == r . id ) & ( ttable . deleted != True ) ) if r . component_id : query &= ( ttable . id != r . component_id ) rows = db ( query ) . select ( ttable . language ) for row in rows : selectable . pop ( row . language , None ) if ( ( len ( selectable ) == 0 ) or ( not any ( ( ( opt in all_options ) for opt in selectable ) ) ) ) : r . component . configure ( insertable = False ) requires . _select = selectable return True s3 . prep = prep return s3_rest_controller ( rheader = s3db . dc_rheader )
launches a qmessagebox question with the provided title and message .