Interesting. This is missing from the book.
db.export_to_csv_file(open('dump.csv','w'))
then later
db.import_from_csv_file(open('dump.csv'), map = {})
The map will fix all references from imported data. Works for individual
data to but you have to pass the same same dict ({}) to the different
import_form_csv_file
On Thursday, 23 January 2014 11:39:51 UTC-6, Mark Billion wrote:
>
> I know that this is a dumb question, but I have a database with static
> data entry ids 17 to 100. When I download the CSV, it has the x.id field
> and the corresponding number. However, when I create a new database and
> upload the data using the db admin, it automatically renumbers these
> entries. Because its static, I have been referencing it by id -- so
> renumbering throws this off.
>
> Anything I can do?
>
--
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/groups/opt_out.