OK guys!
My concrete suggestion:

   - Add attrubute _insert_with_returning to Table class
   - Fix adapter Postgres.py :
   
 
 def _insert(self, table, fields):       
        table_rname = table.sqlsafe
        if fields:
            keys = ','.join(f.sqlsafe_name for f, v in fields)
            values = ','.join(self.expand(v, f.type) for f, v in fields)
            if table._id *and table._insert_with_returning*:
                self._last_insert = (table._id, 1)
                return 'INSERT INTO %s(%s) VALUES (%s) RETURNING %s;' % (
                    table_rname, keys, values, table._id.name)
            else:
                self._last_insert = None
                return 'INSERT INTO %s(%s) VALUES (%s);' % (table_rname, 
keys, values)
        else:
            self._last_insert
            return self._insert_empty(table)

That's All Folks

-- 
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