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

Regression fix - revert commit 05d8d1d260fe1cfe61a89ef0ae09c78513022f3c #423

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

desecho
Copy link
Contributor

@desecho desecho commented Feb 23, 2017

I upgraded django_tables2 and an error occurs if I don't revert the commit which removes code which checks if there is a defined get_queryset method which is my case.

@jieter
Copy link
Owner

jieter commented Feb 27, 2017

@desecho thanks for the PR.

Can you please elaborate on the rationale for this?

The reason for removal was mentioned in the code comment, I'm not sure from your PR description why that doesn't hold.

@desecho
Copy link
Contributor Author

desecho commented Feb 27, 2017

Basically here's the code to see the error (it disappears after commit revert):

class TestView(SingleTableView):
    model = Product
    template_name = 'test.html'
    table_class = ProductTable

    def get(self, request, *args, **kwargs):
        table = self.get_table()
        return HttpResponse()

    def get_queryset(self):
        return Product.objects.all()

You can download the sample project to reproduce the error here - http://desecho.org/djtest_django_tables2.zip

@jieter jieter merged commit 360b29c into jieter:master Mar 6, 2017
jieter added a commit that referenced this pull request Mar 6, 2017
@jieter
Copy link
Owner

jieter commented Mar 6, 2017

@desecho thanks, merged.

It's very helpful if you provide a test or example code like you dit, but it's even better if you provide a test runnable in the django-tables2 test suite demonstrating the problem. I added such a test in 7dd5a16.

@jieter
Copy link
Owner

jieter commented Mar 6, 2017

released 1.4.2

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

Successfully merging this pull request may close these issues.

None yet

2 participants