Giter Site home page Giter Site logo

Comments (5)

jkkjonah avatar jkkjonah commented on July 17, 2024

Test that reproduces the issue w/ Django 1.8.*: #92

from django-safedelete.

Gagaro avatar Gagaro commented on July 17, 2024

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.

Gagaro avatar Gagaro commented on July 17, 2024

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.

Gagaro avatar Gagaro commented on July 17, 2024

Fixed in ab96e7b, thanks everyone for the help.

from django-safedelete.

Gagaro avatar Gagaro commented on July 17, 2024

0.4.5 has been released with the fix

from django-safedelete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.