def mark_sender():
 try:
  mid = request.args[0]
 except:
  raise SyntaxError
 mtable = s3db.msg_message
 stable = s3db.msg_sender
 srecord = db((mtable.id == mid)).select(mtable.from_address, limitby=(0, 1)).first()
 sender = srecord.from_address
 record = db((stable.sender == sender)).select(stable.id, limitby=(0, 1)).first()
 if record:
  args = 'update'
 else:
  args = 'create'
 url = URL(f='sender', args=args, vars=dict(sender=sender))
 redirect(url)

def mark_sender ( ) : try : mid = request . args [ 0 ] except : raise SyntaxError mtable = s3db . msg_message stable = s3db . msg_sender srecord = db ( ( mtable . id == mid ) ) . select ( mtable . from_address , limitby = ( 0 , 1 ) ) . first ( ) sender = srecord . from_address record = db ( ( stable . sender == sender ) ) . select ( stable . id , limitby = ( 0 , 1 ) ) . first ( ) if record : args = 'update' else : args = 'create' url = URL ( f = 'sender' , args = args , vars = dict ( sender = sender ) ) redirect ( url )
assign priority to the given sender .