What is the use case for controlling the id like this?

Does the id in question exist already or are you trying to fill in
"empty" ids?  If it exists already, why don't you update the existing
entry?  If the id does not exist already, then why is it important to
control the value?


On Mar 4, 9:41 am, ceej <cjlaz...@googlemail.com> wrote:
> Hey,
>
> I really think by doing db.your_table.insert(id=2,name='test') should
> override the tables id being inserted to 2 (or whatever you set).
>
> Other wise you have to do:
>
> new_row=db.your_table.insert(name='test')
> db(db.your_table.id==new_row).update(id=2)
> db.commit()
--~--~---------~--~----~------------~-------~--~----~
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