Skip to content

make that table "delete" returns the count of deleted objects #1155

@jcouto

Description

@jcouto

Request to change the return behavior of "delete"

Problem

The table delete method returns the number of objects that fit the query as "delete_count".
When the delete is aborted it returns a positive number.

Workaround

If inside the inherited delete method, check the len(self) to know if deleted.

Requirements

Return the number of deleted objects

Justification

This can be used to perform actions only if the objects were deleted

Related Errors

There are no errors but it is not intuitive that when no objects are deleted the function returns the number of objects that could have been deleted. :)

Metadata

Metadata

Labels

enhancementIndicates new improvementsstaleIndicates issues, pull requests, or discussions are inactive

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions