upgrad / django-deletes Goto Github PK
View Code? Open in Web Editor NEWA fully functional soft deletes (logical deletes) for django.
License: MIT License
A fully functional soft deletes (logical deletes) for django.
License: MIT License
Restores a deleted instance of a Deletable model.
(Need to decide if it restores just the instance or all cascading instances. )
Usually users do not care about old records, deleted records. Soft delete is mostly used for keeping a buffer or some kind of safety mechanism that saves the users data in unnecessary delete option. In the long run it doesnt make sense to keep old records and a clean up action may be desirable.
question = Question.objects.all()[100]
question.delete() - Corresponsing Answers are also deleted here
deleted_question = Question.objects.all_with_deleted(pk=q.id)
deleted_question.answers.count() give 0 which is fine
deleted_question.answers.all_with_deleted gives me all the answers rather than answer deleted and related to "deleted_question"
Restore is either cascade or single object restore. There is no way to restore according to the objects that were deleted along with a specific deletion request.
Should they have independent managers, and objects
deals with only live instances? The current options may not be sufficient.
Consider 2 Models Parent, and Child, where Child has a Foreign Key to Parent.
Parent.objects.get(pk=1).child will return a valid object even though it is soft deleted.
django-deletes/djangodeletes/softdeletes/admin.py
Lines 9 to 14 in 05cebc3
Line 14: shouldn't it be *self.odering
instead of *ordering
and: Line 9: list_filter
instead list_display_filter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.