is it possible to insert table twice on same table in web2py?
e.g.
*modules/test_event.py*
def after_insert_event(f, id, table):
time_stamp = current.request.now
client_ip = current.request.client
user_id = current.auth.user_id
origin = '%s/%s' % (current.request.controller, current.request.function)
mail_to = 'ad...@stifix.com'
messages = 'ID %s created in table %s by %s on %s at %s from %s' % (id, 
table, 
  user_id, time_stamp, 
  origin, client_ip)
* # insert table event : worked*
current.db.auth_event.insert(time_stamp = time_stamp, 
client_ip = client_ip, 
user_id = user_id, 
origin = origin, 
description = 'ID %s created in table %s' % (id, table) )

# mail
current.mail.send(mail_to, 
 messages, 
 messages)

* # insert table event : not worked no error traceback occured, but the 
result is not expected*
current.db.auth_event.insert(time_stamp = time_stamp, 
client_ip = client_ip, 
user_id = user_id, 
origin = origin, 
description = 'Email sent to %s ID %s created in table %s' % (mail_to, id, 
table) )

this code only work for the first insert, the second insert is not work (no 
error traceback occured, but the result is not expected.)
is there any way to achieve it using web2py way?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to