This is probably not the right way to it:

    @validate(NewTicketForm(), error_handler=newticket)
    def ticketsave(self, **kw):
        lient_id = request.environ.get('repoze.who.identity')['user']
        provider.add('cp_ticket',values=copy.copy(kw));
        cpt = copy.copy(kw)
        cpt['ticket_id'] = last_insert_id()
        flash('Ticket %s Entered' % cpt['ticket_id'])
        provider.add('cp_ticket_detail',values=cpt);


library function for last_insert_id()

from tg import config

def last_insert_id():
  engine = config['pylons.app_globals'].sa_engine
  lid = engine.execute("select last_insert_id() as last_insert_id")
  for row in lid:
    last_insert_id = row['last_insert_id']
  return last_insert_id

It'll have to do until I can figure out the proper way to do this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to