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

Queryset get_or_create raises SoftDeleteException #33

Open
fedehuguet opened this issue Apr 21, 2021 · 1 comment
Open

Queryset get_or_create raises SoftDeleteException #33

fedehuguet opened this issue Apr 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@fedehuguet
Copy link

A simple issue, demonstrated better by example:
image

Simply replacing it with get_or_restore does not solve how I intend to use this method for example:
image

update_or_create also uses get_or_create, maybe it would be better to override get_or_create and catch the SoftDeleteException ?

@DarknessRdg
Copy link
Owner

Hello @fedehuguet !

When try to get an object we expected it to not be soft deleted yet. Maybe a new method called restore_or_create() would be more explicit to the user, than this methods restores if is deleted, otherwise creates the instance. What about it?

@DarknessRdg DarknessRdg added the enhancement New feature or request label May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants