Hello,
I my application ,I have a db in which some row are frequently
deleted, so if for each new data I  save it in db  (automatiquely
incremented) I will have a lot of data and a lot of id "empty".
I think that in this situation when reading data , the program loose
time ..?
So I imagine a piece of code where first I seach for free places for
using the fist one for new data:

                libre=(db.somedata.value==0)
                if len(db(libre).select())>0:           # On free
place
                    le_libre = db(libre).select()[0]
                    db(db.somedata.id==le_libre.id).update
(value=newvalue)
                else:                                   # On new
place
                    somedata_id=db.somedata.insert(value=newvalue)

May be there is a simple way ? (for exemple a
function ...insert_onfree...)

Thank for your comments
Jean-Marc
--~--~---------~--~----~------------~-------~--~----~
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