A Django app to make recyclebin.
Project description
===== Django Recyclebin
Django Recyclebin is a Django app to create recyclebin functionality in your project. you will be able to temporarily delete, restore and permanently delete data.
Quick start
-
Add "recyclebin" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'recyclebin', ]
-
import SoftDeleteMixin ''from recyclebin.models import SoftDeleteMixin''
-
Inherit your model with SoftDeleteMixin
``class Mymodel(SoftDeleteMixin)`` -
Run
python manage.py makemigrationsandpython manage.py migrate. -
import recyclebin functions
from recyclebin.functions import get_deleted_items, restore, permanent_delete -
How to temporarily delete. you don't need to do anything. after inheriting your model with SoftDeleteMixin. your regular .delete() method will temporarily delete objects
-
How to view deleted items create a list of models from myapp.models import Model1, Model2, Model3... li = [Model1, Model2, Model3...]
get_deleted_items(li)''This function will return serialized response that will contain model_name, name, pk, deleted_by, deleted_at''
YOUR MODEL MUST HAVE NAME FIELD OTHERWISE NONE WILL BE RETURNED INSTEAD OF NAME
-
How to restore pass restore function model name and id. model name must be string and id an integer
restore(model1, 1) -
How to permanently delete pass permanent_delete function model name and id. model name must be string and id an integer
permanent_delete(model1, 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_recyclebin-0.2-py3-none-any.whl.
File metadata
- Download URL: django_recyclebin-0.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8af4f1b6f4ffa29e61316e92d1948d92056a46b4f650adc922d06e8af7cf40d
|
|
| MD5 |
6156e357b153d449f895fe599bd13bd7
|
|
| BLAKE2b-256 |
352937690e4945556ec4c317f0a957d6904716528a7cf8b3478e631a0f4465b4
|