KeyError: Got KeyError when attempting to get a value for a simple CharField declared in the Meta fields on serializer #8420
Replies: 3 comments 1 reply
-
Could you please provide your |
Beta Was this translation helpful? Give feedback.
-
Sure, ContractPagination is inheriting from DRF's PageNumberPagination
and |
Beta Was this translation helpful? Give feedback.
-
Is it fixed yet ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Calling
get
forContractListAPIView
fetches the results correctly but rendering them with the DRF templates raises a KeyError (for reference further on, 'name' is a models.CharField on the Contract model). I have seen this error before on DRF rendering since moving to python3.8 but back then it was related to a field inheriting from PrimaryKeyRelatedField so I said maybe that one was messing something up. But here it's just a simple model CharField. Is this a known issue? Does it have a solution?Beta Was this translation helpful? Give feedback.
All reactions