Deletes the contents of a query
(self)
| 990 | .save() |
| 991 | |
| 992 | def delete(self): |
| 993 | """ |
| 994 | Deletes the contents of a query |
| 995 | """ |
| 996 | # validate where clause |
| 997 | partition_keys = set(x.db_field_name for x in self.model._partition_keys.values()) |
| 998 | if partition_keys - set(c.field for c in self._where): |
| 999 | raise QueryException("The partition key must be defined on delete queries") |
| 1000 | |
| 1001 | dq = DeleteStatement( |
| 1002 | self.column_family_name, |
| 1003 | where=self._where, |
| 1004 | timestamp=self._timestamp, |
| 1005 | conditionals=self._conditional, |
| 1006 | if_exists=self._if_exists |
| 1007 | ) |
| 1008 | self._execute(dq) |
| 1009 | |
| 1010 | def __eq__(self, q): |
| 1011 | if len(self._where) == len(q._where): |
nothing calls this directly
no test coverage detected