Hello everyone and happy new year!
I'm having an issue regarding the updating and deletion of a row in my
tables and I can't find any solution, so I hope you can help me.
1) Regarding to the update:
As far as I know, to update a row I should do something like this:
query = db(db.table.field1=='What I am looking for')
query.update(field2='hello')
rows = query.select()
row = rows[0]
row.update_record()
But this is not working, it doesn't update the row.
However, if I do this:
query = db(db.table.field1=='What I am looking for')
query.update(field2='hello')
This works, and in the Database Appadmin I can see the row with the updated
value.
So, I'm confused about the use of update and update_record, is ok if I only
use update(...)?
2) Regarding to the delete:
I'm deleting a row with this code:
query = db(db.table.field1=='What I am looking for')
deletedRow = query.delete()
It seems that everything goes well because there is no crash no error
reported and deletedRow has a good value.
The problem is that if I open this table with Database AppAdmin and refresh
it, the (supposed deleted) row is still there.
Is the row really deleted, I guess not, so what could I be doing wrong?
Thank you very much and kind regards!
--