Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation #57

Open
RedMoon32 opened this issue Jun 27, 2019 · 11 comments
Open

No documentation #57

RedMoon32 opened this issue Jun 27, 2019 · 11 comments

Comments

@RedMoon32
Copy link
Contributor

RedMoon32 commented Jun 27, 2019

It would be great if you add documentation on available model and queryset actions, because reading someone's code is not the best way to understand how system works, i can add it btw

@HeinrichWizardKreuser
Copy link

I would really love to see some documentation because I would like to use the library, but I don't know how to. How does one implement it after installing it? As I understand, after it is implemented, you can just delete objects by calling .delete() on them.

@RedMoon32
Copy link
Contributor Author

Interesting to know if this project still is maintained)

@RedMoon32
Copy link
Contributor Author

Oh, last commit 13 days ago so yeah, when i have time i will make pr for documentation

@HeinrichWizardKreuser
Copy link

I see you have a similar library in your repositories https://github.com/RedMoon32/django-softdelete-it. You have actual steps and all so I decide to use that. If you think that scoursen's library is better (even without documentation), say so, but I'm going to try out yours firs

@RedMoon32
Copy link
Contributor Author

Well, i would recommend to still use this library because softdelete-it is kinda piece of sh*t ) It uses UUID rather than boolean field in model. So again use this, btw main part is easy and i will describe it:
https://github.com/scoursen/django-softdelete/blob/master/softdelete/models.py is a main file, as i understand main options in library are:
-deleted_at field - time when model was deleted (or none if not),
-obj.delete() which will set deleted_at to some time (if you call delete() to deleted object again it will be hard-deleted),
obj.undelete(),
Model.objects will return all undeleted objects,
Model.objects.all_with_deleted() will return all objects.
Hope this will help)

@HeinrichWizardKreuser
Copy link

Hi, I actually just ran into "badly formed hexadecimal UUID string" error when trying to access all_objects. If I can get past that, the rest should be fine. I've finished implementing it (lol, used a boolean field "deleted" before and just filtered through all objects that have deleted=False). Do you perhaps know how I can access all soft deleted objects? Let's say I have a Model "Item". I'm currently trying to access all soft deleted Items. I'm currently using Item.all_objects.only_deleted(), but it throws the "badly formed hexadecimal UUID string" error. Any help would be appreciated. However, if it is too much of a struggle and it seems impossible, I'll go to the original softdelete thing. It's just that I've already implemented yours is all so want to see if I can make it work

@RedMoon32
Copy link
Contributor Author

RedMoon32 commented Jun 28, 2019 via email

@HeinrichWizardKreuser
Copy link

Noted. In that case, if possible, please at doc to it? I'll work off of your current rough summary in the mean time. Thanks for all of your help! It is very much appreciated!

@HeinrichWizardKreuser
Copy link

  1. What is the name that I must use to inherit the deletemodel?
  2. What does the import line look like?
  3. Do I need to add any def() to my current classes that wish to implement it or does it work like the one you forked? (Where no extra def() is needed)

@RidenShark
Copy link

Same here. Documentation would be nice for beginners like me. The readme is too vague. Does anyone know a better library?

@ahmedsafadii
Copy link

how the hell this library works, !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants