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

Django 2.0 support #1532

Closed
lordi opened this issue Oct 30, 2017 · 6 comments
Closed

Django 2.0 support #1532

lordi opened this issue Oct 30, 2017 · 6 comments

Comments

@lordi
Copy link

lordi commented Oct 30, 2017

Django 2.0 is currently in beta.

tastypie/resources.py:2036: AttributeError
        if getattr(self._meta, 'queryset', None) is not None:
            # Get the possible query terms from the current QuerySet.
>           query_terms = self._meta.queryset.query.query_terms
E           AttributeError: 'Query' object has no attribute 'query_terms'

It seems like internal attribute query_terms will be removed.
In order to have a smooth transition for the users once it is released, this should be resolved.

@lhopkins
Copy link

This is actually already fixed in #1520. Just needs to be released to PyPI. @georgedorn

@Lcstyle
Copy link

Lcstyle commented Dec 14, 2017

ahhhh OK, thanks.. glad I found this, saved me a lot of trouble as I am just beginning with django / tastypie (FYI : this issue will impact any beginner using basic examples)

@Lcstyle
Copy link

Lcstyle commented Dec 14, 2017

ack, I get a new stack trace now, (after installing tastyPie from master)
I'll have to abandon using tastypie for now, (as a beginner, i need to focus on just getting my base code to work). Here's the stacktrace for posterity, let me know if you'd like me to open a new ticket.

Traceback (most recent call last):
File "C:\venv\lib\site-packages\tastypie\resources.py", line 227, in wrapper
response = callback(request, *args, **kwargs)
File "C:\venv\lib\site-packages\tastypie\resources.py", line 467, in dispatch_list
return self.dispatch('list', request, **kwargs)
File "C:\venv\lib\site-packages\tastypie\resources.py", line 499, in dispatch
response = method(request, **kwargs)
File "C:\venv\lib\site-packages\tastypie\resources.py", line 1363, in get_list
for obj in to_be_serialized[self._meta.collection_name]
File "C:\venv\lib\site-packages\tastypie\resources.py", line 1363, in
for obj in to_be_serialized[self._meta.collection_name]
File "C:\venv\lib\site-packages\tastypie\resources.py", line 918, in full_dehydrate
data[field_name] = method(bundle)
File "C:\venv\lib\site-packages\tastypie\resources.py", line 1091, in dehydrate_resource_uri
return self.get_resource_uri(bundle)
File "C:\venv\lib\site-packages\tastypie\resources.py", line 836, in get_resource_uri
return self._build_reverse_url(url_name, kwargs=self.resource_uri_kwargs(bundle_or_obj))
File "C:\venv\lib\site-packages\tastypie\resources.py", line 815, in resource_uri_kwargs
kwargs.update(self.detail_uri_kwargs(bundle_or_obj))
File "C:\venv\lib\site-packages\tastypie\resources.py", line 792, in detail_uri_kwargs
kwargs[self._meta.detail_uri_name] = getattr(bundle_or_obj, self._meta.detail_uri_name)
AttributeError: 'dict' object has no attribute 'pk'

@Tonsofattraction
Copy link

how's it going? :)

@Eagllus
Copy link

Eagllus commented Mar 27, 2018

When will there be a new release? currently Tastypie 0.14 has been out for quite a while.
#1520 has been merged on 12 July 2017 but there has been no new release for with the fix.

@georgedorn
Copy link
Contributor

Superceded by #1546.

@django-tastypie django-tastypie locked as resolved and limited conversation to collaborators Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants