You cannot. You need to break your CSV into two. One with
table1.id, table1.name
1, "name"
etc etc
and one with
table2.table1, table2.name
1, "other name"
etc etc
Then you must be imported with
d={}
db.table1.import_from_csv_field(open('table1.csv','r'),d)
db.table2.import_from_csv_field(open('table2.csv','r'),d)
The d will fix references.
Massimo
On Mar 16, 12:08 am, weheh <[email protected]> wrote:
> I'm not sure I see how this is possible. Example with 2 tables:
>
> db.define_table('table1',SQLField('name','string'))
> db.define_table('table2',SQLField('table1',db.table1),SQLField
> ('name','string'))
>
> So multiple table2's can point to one table1.
>
> For this example, what would my CSV look like assuming table1 is empty
> to begin with and I want to load up multiple table1 and table2 values
> in a single import?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---