def sms_outbox():
 if (not auth.s3_logged_in()):
  session.error = T('Requires Login!')
  redirect(URL(c='default', f='user', args='login'))
 tablename = 'msg_sms'
 table = s3db.msg_sms
 s3.filter = (table.inbound == False)
 table.inbound.readable = False
 s3.crud_strings[tablename] = Storage(title_display=T('SMS Details'), title_list=T('Sent SMS'), label_list_button=T('View Sent SMS'), label_delete_button=T('Delete SMS'), msg_record_deleted=T('SMS deleted'), msg_list_empty=T('No SMS currently in Outbox'))
 def postp(r, output):
  if isinstance(output, dict):
   add_btn = A(T('Compose'), _class='action-btn', _href=URL(f='compose'))
   output['rheader'] = add_btn
  return output
 s3.postp = postp
 s3db.configure(tablename, editable=False, insertable=False, listadd=False, list_fields=['id', 'date', 'to_address', 'body'])
 return s3_rest_controller(module, 'sms')

def sms_outbox ( ) : if ( not auth . s3_logged_in ( ) ) : session . error = T ( 'Requires Login!' ) redirect ( URL ( c = 'default' , f = 'user' , args = 'login' ) ) tablename = 'msg_sms' table = s3db . msg_sms s3 . filter = ( table . inbound == False ) table . inbound . readable = False s3 . crud_strings [ tablename ] = Storage ( title_display = T ( 'SMS Details' ) , title_list = T ( 'Sent SMS' ) , label_list_button = T ( 'View Sent SMS' ) , label_delete_button = T ( 'Delete SMS' ) , msg_record_deleted = T ( 'SMS deleted' ) , msg_list_empty = T ( 'No SMS currently in Outbox' ) ) def postp ( r , output ) : if isinstance ( output , dict ) : add_btn = A ( T ( 'Compose' ) , _class = 'action-btn' , _href = URL ( f = 'compose' ) ) output [ 'rheader' ] = add_btn return output s3 . postp = postp s3db . configure ( tablename , editable = False , insertable = False , listadd = False , list_fields = [ 'id' , 'date' , 'to_address' , 'body' ] ) return s3_rest_controller ( module , 'sms' )
restful crud controller for the sms outbox - all sent sms are visible here .