You can use the method to export/import the all tables at once <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--all-tables-at-once-> - that will handle all the references automatically. If you want to limit it to a subset of the tables, just run the export/import commands after defining only those tables (any tables not yet defined will be invisible to the DAL and therefore won't be exported/imported).
Anthony On Wednesday, November 18, 2015 at 10:35:32 AM UTC-5, Carla Raquel wrote: > > I'm having some troubles importing from csv files while using a Postgres > connection, when a table has one or more references to other tables like so: > > db.define_table('Extension', > Field('Person',db.auth_user), > Field('Supervisor',db.auth_user), > Field('Number','integer'), > Field('Description','text') > > > > I have created this and the auth_user table on Postgres and imported the > auth_user contents from the csv file with no problems. I also have no > problems importing to other tables that have no external references. I have > the following error: ('Error', '23503','insert or update on table > "extensao" violates foreign key constraint "extension_person_fkey"'). Any > ideas? > -- 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.