Check the existence of an object before an update or delete. If the update or delete isn't applied, a LWTException is raised.
(self)
| 1189 | return clone |
| 1190 | |
| 1191 | def if_exists(self): |
| 1192 | """ |
| 1193 | Check the existence of an object before an update or delete. |
| 1194 | |
| 1195 | If the update or delete isn't applied, a LWTException is raised. |
| 1196 | """ |
| 1197 | if self.model._has_counter: |
| 1198 | raise IfExistsWithCounterColumn('if_exists cannot be used with tables containing counter columns') |
| 1199 | clone = copy.deepcopy(self) |
| 1200 | clone._if_exists = True |
| 1201 | return clone |
| 1202 | |
| 1203 | def update(self, **values): |
| 1204 | """ |