OK
pydal.py/base.py:

TABLE_ARGS=set((... , 'insert_with_returning'))



pydal.py/objects.py:
class Table(object):
    ...
    def __init__(...):
        ...
        self._insert_with_returning=args.get('insert_with_returning', True)
        ...


pydal.py/adapters/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) 
 

 

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