So let's say I have a CSV with:

id,name
1,Bob
2,Mary
3,John

let's say I update the CSV to the following:

id,name
1,Bob
2,Sue
3,John

How would I use id_map parameter to make this change happen so the table 
updates appropriately?


On Tuesday, July 24, 2018 at 7:10:21 PM UTC+8, Leonel Câmara wrote:
>
> This something used very frequently when you're making code to import 
> something. You can have a map (a dictionary) that maps existing record ids 
> to the ids that are present in the csv. This is used for two reasons, to 
> update records instead of inserting new ones when you have already imported 
> once, and two to "fix" references between tables to the actual ids in the 
> database you imported the data in.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to