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

Error getting datasets/ site/ plots/ people/ #16

Closed
vchendrix opened this issue Nov 4, 2016 · 1 comment
Closed

Error getting datasets/ site/ plots/ people/ #16

vchendrix opened this issue Nov 4, 2016 · 1 comment
Assignees
Labels

Comments

@vchendrix
Copy link
Contributor

Environment:

Request Method: GET
Request URL: http://localhost:9999/api/v1/datasets/

Django Version: 1.10.3
Python Version: 3.4.3
Installed Applications:
['ngt_archive',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'archive_api.apps.ArchiveApiConfig',
'rest_framework']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/vagrant/.venv/lib/python3.4/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)

File "/vagrant/.venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)

File "/vagrant/.venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "/vagrant/.venv/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/vagrant/.venv/lib/python3.4/site-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/viewsets.py" in view
83. return self.dispatch(request, *args, **kwargs)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/views.py" in dispatch
477. response = self.handle_exception(exc)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/views.py" in handle_exception
437. self.raise_uncaught_exception(exc)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/views.py" in dispatch
474. response = handler(request, *args, **kwargs)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/mixins.py" in list
48. return Response(serializer.data)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in data
725. ret = super(ListSerializer, self).data

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in data
262. self._data = self.to_representation(self.instance)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in to_representation
643. self.child.to_representation(item) for item in iterable

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in
643. self.child.to_representation(item) for item in iterable

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in to_representation
479. fields = self._readable_fields

File "/vagrant/.venv/lib/python3.4/site-packages/django/utils/functional.py" in get
35. res = instance.dict[self.name] = self.func(instance)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in _readable_fields
373. field for field in self.fields.values()

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in fields
359. for key, value in self.get_fields().items():

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in get_fields
980. field_names = self.get_field_names(declared_fields, info)

File "/vagrant/.venv/lib/python3.4/site-packages/rest_framework/serializers.py" in get_field_names
1053. serializer_class=self.class.name

Exception Type: AssertionError at /api/v1/datasets/
Exception Value: ("Creating a ModelSerializer without either the 'fields' attribute or the 'exclude' attribute has been deprecated since 3.3.0, and is now disallowed. Add an explicit fields = 'all' to the DataSetSerializer serializer.",)

@vchendrix vchendrix added the bug label Nov 4, 2016
@vchendrix vchendrix self-assigned this Nov 4, 2016
@vchendrix vchendrix removed this from the M1 - Simple Dataset Prototype milestone Nov 4, 2016
@vchendrix
Copy link
Contributor Author

This issue was not reproducible. It only happened in development. This was resolve with a new development environment for the developer

vchendrix added a commit that referenced this issue Apr 14, 2017
Fixes #16

Could not reproduce the original error on a VM. The solution from the error message was to add *fields = '__all__'* which has been done for all serializers that didn't have a field attribute

Additionally, added instruction for setting up development on a local machine instead of using a VM
vchendrix added a commit that referenced this issue Apr 15, 2017
Fixes #16

Could not reproduce the original error on a VM. The solution from the error message was to add *fields = '__all__'* which has been done for all serializers that didn't have a field attribute

Additionally, added instruction for setting up development on a local machine instead of using a VM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant