Hi I have the following table: db.define_table("products", Field("categoryID", db.productCategory, writable=False, readable=False, requires=IS_IN_DB(db, "productCategory.id", "productCategory.name") ), # reference field Field("productName", 'string',length=512, default=None), Field("description", 'text',default=None) )
- I have a list of (20000) rows that might contain products and I would like to update my table. However some products might already be in the db while others are completely new. - I want to insert a row if it does not exist in the db (productName could play the role of the identifier here) is already there AND update a row in the case the product already exists in the DB> I can do it pretty easily if I go item by item and check if it already exits in the db and then take the appropriate action (insert or update). What I am looking for is the most efficient way to do this (especially on GAE). thanks Miguel