unless you're updating the corresponding rows whenever the user clicks on 
it, deleting them all and then reinserting them it's one of the two ways to 
go. 
I'd just "vote" for update_or_insert() if you're concerned about keeping 
the same original ids as long as the user doesn't modify those, but that's 
highly app dependant.
However, in "practical database theory", if you're going to fetch a lot of 
times those records and you want them "often" to be all skills for a single 
user, you'd better have them not scattered among your "huge" table (read: 
it's better to have them in sequential order), in order to optimize 
database seeks.


On Sunday, July 21, 2013 7:38:46 PM UTC+2, ssuresh wrote:
>
> Hi,
>
> I have a table userskills with the following structure
>
>  {user_id,user_skills,skill_rating}..
>
> It can have values like
>
> {1,java,5}
> {1,python,6}
> {1,javascript,9}
> {2,java,3}
>
> etc
>
> For a particular user, I will show him an editable grid (jquery based) 
> containing all his skills and ratings. He can add new rows for new skills 
> and delete and modify existing skills. He can then submit the form in one 
> go..
>
> My question is
>
> How can i update the values in the database? Currently what I am doing is 
> deleting all records in the table for that user and then bulk updating the 
> new values  . Is this the best approach for such a scenario? Is there is a 
> better way of doing this?
>
> thanx,
> Suresh
>
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to