Working in an inherited codebase.
I have a table with 2 objects when I look at it from the API or from the admin site, but it has 3 objects when I do a select * in PostgreSQL.
name | created | deleted
-------+-------------------------------+------------
Sweet | 2017-07-21 16:31:28.556949-05 | t
qwer | 2017-07-21 16:36:03.096954-05 | t
asdf | 2017-07-21 16:35:15.585589-05 | f
(3 rows)
There is a 'deleted' flag in that table which appears to be an automagic soft-deletion flag. If I set the flag true through SQL, it's visible to ORM. If I set the flag false through SQL, it's hidden from ORM.
This particular type of automagic is extremely unhelpful and I want to disable it, but I'd like to understand how this works in Django before I go removing the column.
I am not using anything special to support this behavior. I have found articles which describe how to achieve soft deletion by subclassing special models that support it, but I'm doing none of that. This is just a vanilla subclass of models.Model. I have Googled and searched through the Django docs and I don't see anything that would indicate that just having a "deleted" column gives you soft deletion.
My questions are:
- Does Django have some kind of automatic soft deletion support?
- If so, where can I find the documentation?
- If not, is there some other automatic mechanism I'm not understanding?