{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-python/graphene-django/issues/242","repository_url":"https://api.github.com/repos/graphql-python/graphene-django","labels_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/242/comments","events_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/242/events","html_url":"https://github.com/graphql-python/graphene-django/issues/242","id":249667846,"number":242,"title":"Several 'RemovedInDjango20Warning's with Django 1.11 (field.rel, ForeignObjectRel.to)","user":{"login":"edmorley","id":501702,"avatar_url":"https://avatars3.githubusercontent.com/u/501702?v=4","gravatar_id":"","url":"https://api.github.com/users/edmorley","html_url":"https://github.com/edmorley","followers_url":"https://api.github.com/users/edmorley/followers","following_url":"https://api.github.com/users/edmorley/following{/other_user}","gists_url":"https://api.github.com/users/edmorley/gists{/gist_id}","starred_url":"https://api.github.com/users/edmorley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmorley/subscriptions","organizations_url":"https://api.github.com/users/edmorley/orgs","repos_url":"https://api.github.com/users/edmorley/repos","events_url":"https://api.github.com/users/edmorley/events{/privacy}","received_events_url":"https://api.github.com/users/edmorley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-11T15:20:54Z","updated_at":"2017-12-21T13:10:24Z","closed_at":"2017-09-01T07:46:22Z","author_association":"CONTRIBUTOR","body":"Hi!\r\n\r\nWhen running our test suite with Python warnings enabled (eg `PYTHONWARNINGS=once pytest`), we get the following deprecation warnings:\r\n\r\n```\r\n  .../site-packages/graphene_django/utils.py:61: RemovedInDjango20Warning: Usage of field.rel has been deprecated. Use field.remote_field instead.\r\n    if hasattr(field, 'rel'):\r\n  .../site-packages/graphene_django/utils.py:63: RemovedInDjango20Warning: Usage of ForeignObjectRel.to attribute has been deprecated. Use the model attribute instead.\r\n    return field.rel.to\r\n```\r\n\r\nThese line numbers correspond to:\r\nhttps://github.com/graphql-python/graphene-django/blob/v1.3/graphene_django/utils.py#L61\r\nhttps://github.com/graphql-python/graphene-django/blob/v1.3/graphene_django/utils.py#L63\r\n\r\nThe deprecation docs for this are here:\r\nhttps://docs.djangoproject.com/en/1.11/releases/1.9/#field-rel-changes\r\n\r\nI'm presuming the solution would be to either:\r\n1) Drop support for Django 1.6/1.7 entirely\r\n2) Invert the conditional, such that it does `hasattr(field, 'related_model')` and if not found then falls back to `field.rel.to`.\r\n\r\nGiven Django <1.8 is EOL and has security vulnerabilities, I'd lean towards solution (1).\r\n\r\nThis was using:\r\n* graphene-django 1.3\r\n* graphene 1.4.1\r\n* Django 1.11.4\r\n* Python 2.7.13\r\n"},"comment":{"url":"https://api.github.com/repos/graphql-python/graphene-django/issues/comments/353346912","html_url":"https://github.com/graphql-python/graphene-django/issues/242#issuecomment-353346912","issue_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/242","id":353346912,"user":{"login":"joeydebreuk","id":25387009,"avatar_url":"https://avatars2.githubusercontent.com/u/25387009?v=4","gravatar_id":"","url":"https://api.github.com/users/joeydebreuk","html_url":"https://github.com/joeydebreuk","followers_url":"https://api.github.com/users/joeydebreuk/followers","following_url":"https://api.github.com/users/joeydebreuk/following{/other_user}","gists_url":"https://api.github.com/users/joeydebreuk/gists{/gist_id}","starred_url":"https://api.github.com/users/joeydebreuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeydebreuk/subscriptions","organizations_url":"https://api.github.com/users/joeydebreuk/orgs","repos_url":"https://api.github.com/users/joeydebreuk/repos","events_url":"https://api.github.com/users/joeydebreuk/events{/privacy}","received_events_url":"https://api.github.com/users/joeydebreuk/received_events","type":"User","site_admin":false},"created_at":"2017-12-21T13:10:24Z","updated_at":"2017-12-21T13:10:24Z","author_association":"NONE","body":"With the versions:\r\n\r\nDjango==1.11\r\ngraphene==2.0\r\ngraphene-django==2.0.0\r\ngraphql-core==2.0\r\n\r\nI get the same warning, and with the versions: \r\n\r\nDjango==2.0\r\ndjango-cors-headers==2.1.0\r\ndjango-filter==1.1.0\r\ndjango-filters==0.2.1\r\ngraphene==2.0\r\ngraphene-django==2.0.0\r\ngraphql-core==2.0\r\n\r\nI get the error: Foreignkey has no attribute: 'rel'"}}
{"actor":{"display_login":"joeydebreuk"}}