Guest User

Untitled

a guest
Aug 23rd, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. >>> y.data
  2. Traceback (most recent call last):
  3. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 441, in get_attribute
  4. return get_attribute(instance, self.source_attrs)
  5. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 100, in get_attribute
  6. instance = getattr(instance, attr)
  7. AttributeError: 'QuerySet' object has no attribute 'cuisine'
  8.  
  9. During handling of the above exception, another exception occurred:
  10.  
  11. Traceback (most recent call last):
  12. File "<console>", line 1, in <module>
  13. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 560, in data
  14. ret = super(Serializer, self).data
  15. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 262, in data
  16. self._data = self.to_representation(self.instance)
  17. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 514, in to_representation
  18. attribute = field.get_attribute(instance)
  19. File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 462, in get_attribute
  20. raise type(exc)(msg)
  21. AttributeError: Got AttributeError when attempting to get a value for field `cuisine` on serializer `FoodCuisineSerializer`.
  22. The serializer field might be named incorrectly and not match any attribute or key on the `QuerySet` instance.
  23. Original exception text was: 'QuerySet' object has no attribute 'cuisine'.
Add Comment
Please, Sign In to add comment