Removes the row which primary key equals the given id.
(self, id, commit=True)
| 978 | self.db.execute(q, commit) |
| 979 | |
| 980 | def delete(self, id, commit=True): |
| 981 | """ Removes the row which primary key equals the given id. |
| 982 | """ |
| 983 | # Table.delete(1) |
| 984 | # Table.delete(ALL) |
| 985 | # Table.delete(all(("type","cat"), ("age",15,">"))) |
| 986 | q = "delete from `%s` where %s" % (self.name, |
| 987 | not isinstance(id, Group) and cmp(self.primary_key, id, "=", self.db.escape) \ |
| 988 | or id.SQL(escape=self.db.escape)) |
| 989 | self.db.execute(q, commit) |
| 990 | |
| 991 | append, edit, remove = insert, update, delete |
| 992 |