How would this apply not using csv and doing a manual
keep_in_sync_row=db.your_table.insert(id=my_own_id,name='test') ?

On Mar 7, 8:12 pm, mdipierro <[email protected]> wrote:
> If the table has a field called "uuid" it is used and the record is
> inserted or updated accordingly.
>
> Massimo
>
> On Mar 7, 6:31 pm, Yarko Tymciurak <[email protected]> wrote:
>
>
>
> > This is really great - it only leaves the use case I outlined - updating
> > rows from csv (or - in the case of UUID / name field of coupon, would this
> > work that way anyway?  Actually, I think so....)
>
> > On Sat, Mar 7, 2009 at 3:15 PM, mdipierro <[email protected]> wrote:
>
> > > Actually if you restore multiple tables using
>
> > > d={}
> > > db.table1.import_from_csv_file(file1,d)
> > > db.table2.import_from_csv_file(file3,d)
> > > ...
>
> > > web2py WILL FIX all your references. The new id will not be the same
> > > as the old ones but the references will reflect the new ids.
> > > This is achieved by storing a map between the original id and the new
> > > id in the d={} dictionary. Give it a try.
>
> > > You can also import_to_csv_field and export_from_csv_file an entire db
> > > (as opposed to an individual table) and the remapping of the ids is
> > > the default behaviour.
>
> > > Massimo
>
> > > On Mar 7, 1:31 pm, Joe  Barnhart <[email protected]> wrote:
> > > > Well, what if I wanted to restore a database with ids used in multi-
> > > > table links?  From what I read of the "import csv" it discards the id
> > > > field and inserts new records -- which will cause any linked records
> > > > from other tables to break.  Come to think of it, I'm not sure how you
> > > > restore a database at all unless the ids can be set explicitly.
>
> > > > At least this is one use case.
>
> > > > -- Joe B.
>
> > > > On Mar 5, 9:49 pm, mdipierro <[email protected]> wrote:
>
> > > > > Why would anybody do such a thing? This can break the integrity of the
> > > > > database.
> > > > <
> > > > > Massimo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to