From: Ian S. <ia...@et...> - 2002-11-27 15:01:19
|
This isn't a webware question per-se but I'd like to ask how people = handle POST's. For instance, I have a page which provides a list of items for deletion. = Check a checkbox on the rows you want to delete and hit the "Delete" = button. def delete(self): self.killSelectedRecords() self.writeHTML() i.e. the user gets a page back with the regenerated list (less those = deleted). The problem for me is the Browser Refresh button. If you click it now = its not going to do what it says ("Refresh"), its going to re-post the = delete action (which could be bad). My temptation is to do : def delete(self): self.killSelectedRecords() self.response().redirect(self.response.url()) #pseudocode! i.e. redirect the browser to do a GET on the page they just POSTed to. Is this what other folks do? What is the approved idiom? What are the = trade-offs and hidden dangers? - Ian Sparks. =20 |