{"action":"created","issue":{"url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/238","labels_url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/238/comments","events_url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/238/events","html_url":"https://github.com/KristianOellegaard/django-hvad/issues/238","id":67590065,"number":238,"title":"Cannot show translatable model fields in Rest framework 3.1.1 (Django 1.8)","user":{"login":"paolostefan","id":1904907,"avatar_url":"https://avatars.githubusercontent.com/u/1904907?v=3","gravatar_id":"","url":"https://api.github.com/users/paolostefan","html_url":"https://github.com/paolostefan","followers_url":"https://api.github.com/users/paolostefan/followers","following_url":"https://api.github.com/users/paolostefan/following{/other_user}","gists_url":"https://api.github.com/users/paolostefan/gists{/gist_id}","starred_url":"https://api.github.com/users/paolostefan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolostefan/subscriptions","organizations_url":"https://api.github.com/users/paolostefan/orgs","repos_url":"https://api.github.com/users/paolostefan/repos","events_url":"https://api.github.com/users/paolostefan/events{/privacy}","received_events_url":"https://api.github.com/users/paolostefan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"spectras","id":5879675,"avatar_url":"https://avatars.githubusercontent.com/u/5879675?v=3","gravatar_id":"","url":"https://api.github.com/users/spectras","html_url":"https://github.com/spectras","followers_url":"https://api.github.com/users/spectras/followers","following_url":"https://api.github.com/users/spectras/following{/other_user}","gists_url":"https://api.github.com/users/spectras/gists{/gist_id}","starred_url":"https://api.github.com/users/spectras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectras/subscriptions","organizations_url":"https://api.github.com/users/spectras/orgs","repos_url":"https://api.github.com/users/spectras/repos","events_url":"https://api.github.com/users/spectras/events{/privacy}","received_events_url":"https://api.github.com/users/spectras/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-04-10T13:02:38Z","updated_at":"2015-04-11T18:18:58Z","closed_at":null,"body":"The docs lack a working example of how to implement a viewset with translatable fields, or a TranslatableMixin.\r\nThe issue is detailed in this Stackoverflow question: http://stackoverflow.com/q/29554903/719247"},"comment":{"url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/comments/91894956","html_url":"https://github.com/KristianOellegaard/django-hvad/issues/238#issuecomment-91894956","issue_url":"https://api.github.com/repos/KristianOellegaard/django-hvad/issues/238","id":91894956,"user":{"login":"paolostefan","id":1904907,"avatar_url":"https://avatars.githubusercontent.com/u/1904907?v=3","gravatar_id":"","url":"https://api.github.com/users/paolostefan","html_url":"https://github.com/paolostefan","followers_url":"https://api.github.com/users/paolostefan/followers","following_url":"https://api.github.com/users/paolostefan/following{/other_user}","gists_url":"https://api.github.com/users/paolostefan/gists{/gist_id}","starred_url":"https://api.github.com/users/paolostefan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolostefan/subscriptions","organizations_url":"https://api.github.com/users/paolostefan/orgs","repos_url":"https://api.github.com/users/paolostefan/repos","events_url":"https://api.github.com/users/paolostefan/events{/privacy}","received_events_url":"https://api.github.com/users/paolostefan/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T18:18:58Z","updated_at":"2015-04-11T18:18:58Z","body":"Hi, thanks a lot for your effort and prompt answer.\r\n\r\nI'm running Python 2.7.9, maybe it's part of the problem. The project is pretty big and runs on a Mac, but I tried to replicate only the relevant bits on a Windows machine and got the same error (using python 2.7.9). So maybe the two things are related.\r\n\r\n**Detail info follows**\r\n\r\n`pip freeze`outputs:\r\n \r\nDjango==1.8\r\ndjango-allauth==0.19.1\r\ndjango-countries-plus==0.3.3\r\ndjango-filter==0.9.2\r\ndjango-grappelli==2.6.3\r\ndjango-guardian==1.2.5\r\ndjango-hvad==1.2.0\r\ndjango-languages-plus==0.1.5\r\ndjango-social-auth==0.7.28\r\ndjangorestframework==3.0.5\r\neasy-thumbnails==2.2\r\necdsa==0.11\r\nFabric==1.10.1\r\nhtml2text==2015.2.18\r\nhttplib2==0.9\r\nMarkdown==2.6.1\r\noauth2==1.5.211\r\noauthlib==0.7.2\r\nparamiko==1.15.2\r\nPillow==2.7.0\r\npsycopg2==2.5.4\r\npycrypto==2.6.1\r\nPyJWT==0.4.1\r\npython-openid==2.2.5\r\npython-social-auth==0.2.1\r\nrequests==2.5.1\r\nrequests-oauthlib==0.4.2\r\nsix==1.9.0\r\n\r\nThe error page contains this message:\r\n\r\nWrongManager at /it/api/v1/websites/\r\nTo access translated fields like 'url' from an untranslated model, you must use a translation aware manager. For non-translatable models, you can get one using hvad.utils.get_translation_aware_manager.\r\nFor translatable models, use the language() method.\r\nRequest Method:\tGET\r\nRequest URL:\thttp://127.0.0.1:8000/it/api/v1/websites/\r\nDjango Version:\t1.8\r\nException Type:\tWrongManager\r\nException Value:\t\r\nTo access translated fields like 'url' from an untranslated model, you must use a translation aware manager. For non-translatable models, you can get one using hvad.utils.get_translation_aware_manager.\r\nFor translatable models, use the language() method.\r\nException Location:\t/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/hvad/utils.py in __call__, line 139\r\nPython Executable:\t/Users/paolostefan/.virtualenvs/quaderno_s/bin/python\r\nPython Version:\t2.7.9\r\nPython Path:\t\r\n['/Users/paolostefan/Sites/quaderno/quaderno_s',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python27.zip',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/plat-darwin',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/plat-mac',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/plat-mac/lib-scriptpackages',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/lib-tk',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/lib-old',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/lib-dynload',\r\n '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',\r\n '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',\r\n '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',\r\n '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',\r\n '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',\r\n '/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages']\r\n\r\n**Full stack trace start**\r\n-------\r\nEnvironment:\r\n\r\nRequest Method: GET\r\nRequest URL: http://127.0.0.1:8000/it/api/v1/websites/\r\n\r\nDjango Version: 1.8\r\nPython Version: 2.7.9\r\nInstalled Applications:\r\n('grappelli',\r\n 'django.contrib.admin',\r\n 'django.contrib.auth',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.messages',\r\n 'django.contrib.staticfiles',\r\n 'django.contrib.sites',\r\n 'countries_plus',\r\n 'languages_plus',\r\n 'rest_framework',\r\n 'hvad',\r\n 'easy_thumbnails',\r\n 'allauth',\r\n 'allauth.account',\r\n 'allauth.socialaccount',\r\n 'allauth.socialaccount.providers.facebook',\r\n 'allauth.socialaccount.providers.google',\r\n 'skin',\r\n 'scrittori',\r\n 'contenuti',\r\n 'tassonomia')\r\nInstalled Middleware:\r\n('django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n 'django.middleware.locale.LocaleMiddleware')\r\n\r\n\r\nTraceback:\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\r\n  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/django/views/decorators/csrf.py\" in wrapped_view\r\n  58.         return view_func(*args, **kwargs)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/viewsets.py\" in view\r\n  85.             return self.dispatch(request, *args, **kwargs)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/views.py\" in dispatch\r\n  407.             response = self.handle_exception(exc)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/views.py\" in dispatch\r\n  404.             response = handler(request, *args, **kwargs)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/mixins.py\" in list\r\n  46.         return Response(serializer.data)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in data\r\n  615.         ret = super(ListSerializer, self).data\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in data\r\n  212.                 self._data = self.to_representation(self.instance)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in to_representation\r\n  565.             self.child.to_representation(item) for item in iterable\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in to_representation\r\n  419.         fields = [field for field in self.fields.values() if not field.write_only]\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in fields\r\n  312.             for key, value in self.get_fields().items():\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/rest_framework/serializers.py\" in get_fields\r\n  940.                 model_field = model._meta.get_field(model_field_name)\r\nFile \"/Users/paolostefan/.virtualenvs/quaderno_s/lib/python2.7/site-packages/hvad/utils.py\" in __call__\r\n  139.                                    \"method.\" % name)\r\n\r\nException Type: WrongManager at /it/api/v1/websites/\r\nException Value: To access translated fields like 'url' from an untranslated model, you must use a translation aware manager. For non-translatable models, you can get one using hvad.utils.get_translation_aware_manager.\r\nFor translatable models, use the language() method.\r\n----\r\n**Full stack trace end**\r\n"}}