Comments (5)
Test that reproduces the issue w/ Django 1.8.*: #92
from django-safedelete.
2fd3a5f#commitcomment-27160176
I took a stab a this. I have no clue why this happed. I read the Django code base. Seems like QuerySet takes self, flat and *kwargs as arguments. No clue why this happens: https://github.com/django/django/blob/1.8.18/django/db/models/query.py#L1144
This is what we have for 1.11: https://github.com/django/django/blob/1.11.9/django/db/models/query.py#L1106
And the traceback:
Traceback (most recent call last):
File "/home/travis/build/makinacorpus/django-safedelete/safedelete/tests/test_queryset.py", line 202, in test_values_list
QuerySetModel.objects.filter(id=instance.id).values_list('pk', flat=True)[0]
File "/home/travis/build/makinacorpus/django-safedelete/safedelete/queryset.py", line 121, in __getitem__
return super(SafeDeleteQueryset, self).__getitem__(key)
File "/home/travis/build/makinacorpus/django-safedelete/django/django/db/models/query.py", line 199, in __getitem__
qs = self._clone()
File "/home/travis/build/makinacorpus/django-safedelete/django/django/db/models/query.py", line 1244, in _clone
clone = super(ValuesListQuerySet, self)._clone(*args, **kwargs)
File "/home/travis/build/makinacorpus/django-safedelete/django/django/db/models/query.py", line 1144, in _clone
c = super(ValuesQuerySet, self)._clone(klass, **kwargs)
TypeError: _clone() takes 1 positional argument but 2 were given
from django-safedelete.
Our implementation is incorrect, we overwrite the _clone
method:
https://github.com/makinacorpus/django-safedelete/blob/master/safedelete/queryset.py#L139-L147
from django-safedelete.
Fixed in ab96e7b, thanks everyone for the help.
from django-safedelete.
0.4.5 has been released with the fix
from django-safedelete.
Related Issues (20)
- Safe delete does not work as expected with OneToOneField HOT 2
- TypeError: cannot unpack non-iterable NoneType object HOT 3
- add type annotation HOT 3
- SafeDeleteQuery AttributeError on _safedelete_visibility and _safedelete_visibility_field HOT 8
- Setting highlight_deleted_field.short_description mistakenly affects all subclasses of SafeDeleteAdmin HOT 1
- Behaviour of SOFT_DELETE on an object with a PROTECTED relationship to another SOFT_DELETED object HOT 1
- Django 4.2 support HOT 1
- Soft delete model object and cascading delete all related objects which are not instance of SafeDeleteModel HOT 2
- deleted_objects is not documented anywhere HOT 2
- Fields uniqueness with MySQL HOT 2
- delete method hangs on raise ProtectedError, when a lot of related protected objects HOT 1
- HARD_DELETE in SafeDeleteQueryset bypasses custom delete logic HOT 1
- Infinite recursive loop with SafeDeleteQueryset HOT 2
- Is it possible to set _safedelete_visibility without having to define a Manager? HOT 1
- cannot unpack non-iterable NoneType object with `SOFT_DELETE_CASCADE` HOT 17
- get_queryset filteration for related models
- If using django-simple-history, is this needed? HOT 2
- How can I use SafeDeleteQueryset and SafeDeleteManager at the same time?
- pkg_resources deprecation warning HOT 1
- Custom UniqueConstraint do not works with OneToOneField HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-safedelete.