Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> y.data
- Traceback (most recent call last):
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 441, in get_attribute
- return get_attribute(instance, self.source_attrs)
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 100, in get_attribute
- instance = getattr(instance, attr)
- AttributeError: 'QuerySet' object has no attribute 'cuisine'
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "<console>", line 1, in <module>
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 560, in data
- ret = super(Serializer, self).data
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 262, in data
- self._data = self.to_representation(self.instance)
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/serializers.py", line 514, in to_representation
- attribute = field.get_attribute(instance)
- File "/home/compro/.local/share/virtualenvs/backend-FjnZ4iaz/lib/python3.7/site-packages/rest_framework/fields.py", line 462, in get_attribute
- raise type(exc)(msg)
- AttributeError: Got AttributeError when attempting to get a value for field `cuisine` on serializer `FoodCuisineSerializer`.
- The serializer field might be named incorrectly and not match any attribute or key on the `QuerySet` instance.
- Original exception text was: 'QuerySet' object has no attribute 'cuisine'.
Add Comment
Please, Sign In to add comment