Skip to content

dropped support for django 1.8 is not clear from release announcement #5491

@JensTimmerman

Description

@JensTimmerman

Checklist

  • I have verified that that issue exists against the master branch of Django REST framework.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • This is not a usage question. (Those should be directed to the discussion group instead.)
  • This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Steps to reproduce

Run a get request against an api endpoint

Expected behavior

normal response

Actual behavior

When I switch from django rest-framework 3.6.4 to 3.7.0 al my testcases with a get request to an api endpoin start failing with following error message

(against django 1.8.18)

switching back to 3.6.4 makes this work again.

Traceback (most recent call last):
  File "/Users/jenstimmerman/workspace/vsc-accountpage/account/tests.py", line 925, in test_account_retrieval
    response = self.client.get(account_url)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/test.py", line 291, in get
    response = super(APIClient, self).get(path, data=data, **extra)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/test.py", line 208, in get
    return self.generic('GET', path, **r)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/test.py", line 237, in generic
    method, path, data, content_type, secure, **extra)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/test/client.py", line 379, in generic
    return self.request(**r)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/test.py", line 288, in request
    return super(APIClient, self).request(**kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/test.py", line 240, in request
    request = super(APIRequestFactory, self).request(**kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/test/client.py", line 466, in request
    six.reraise(*exc_info)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/generics.py", line 201, in get
    return self.list(request, *args, **kwargs)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/mixins.py", line 48, in list
    return Response(serializer.data)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 738, in data
    ret = super(ListSerializer, self).data
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 262, in data
    self._data = self.to_representation(self.instance)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 656, in to_representation
    self.child.to_representation(item) for item in iterable
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 483, in to_representation
    fields = self._readable_fields
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/Django-1.8.18-py2.7.egg/django/utils/functional.py", line 59, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 377, in _readable_fields
    field for field in self.fields.values()
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 363, in fields
    for key, value in self.get_fields().items():
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/serializers.py", line 992, in get_fields
    info = model_meta.get_field_info(model)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/utils/model_meta.py", line 37, in get_field_info
    pk = _get_pk(opts)
  File "/Users/jenstimmerman/workspace/vsc-accountpage/.eggs/djangorestframework-3.7.0-py2.7.egg/rest_framework/utils/model_meta.py", line 50, in _get_pk
    rel = pk.remote_field
AttributeError: 'AutoField' object has no attribute 'remote_field'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions