here's another, simpler use case:
For PyCon2009 we have a financial aid table.  The F/A person took coupons
(discounts) which we generated offline, and with his own script, selected FA
applicants, and assigned the appropriate amounts to each individual in the
coupons.

He did this manually, off line.

I offered that we could probably UPDATE the database with his FA assignment
comments thru CSV - so he wouldn't have to enter twice (he was, I think,
working this in a spreadsheet locally - then generating automatic email,
passing the coupon ID on to the recipients).

What would be useful in this case:

USE id as an identifier of record to modify;  only modify fields loaded (eg.
in this case,  i would only want "id" and "comment" field to be uploaded,
and the comment field of each id to be modified).

I wonder if the appropriate way to go with this would be to make a
MYSQLTable class which inherits from SQLTable, and add a update_from_csv()
 function modeled after insert_from_csv(), but implementing an update
instead of an insert.  As it is, insert_from_csv() checks unique
constraints, and does update() instead of insert in such conditions... this
might complicate unique checks a bit...

....

.... just thinking out loud....



On Sat, Mar 7, 2009 at 1:31 PM, Joe Barnhart <joe.barnh...@gmail.com> 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 <mdipie...@cs.depaul.edu> 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 web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to