Closed Obi-L closed 2 years ago
@Obi-L There are some reserved words in the library that cannot be used as field names. content_type
is one of them.
It is not related to #73.
@rubydog Thank you for the reply. Are these reserved words specific to the Python client, or are they reserved for the Contentful API in general? How can a developer know what these reserved words are -- there doesn't seem to be any error message or warning raised.
If a Contentful field shares the name of an internal class, retrieving the attribute from
Entry
that is meant to return that corresponding object Type returns instead the values of that Contentful field. Specifically, if a field in Contentful is named "Content Type", gettingEntry.content_type
returns the value of that field -- usually astr
orint
-- instead of the expectedContentType
object. No error or warning seems to be triggered.This name collision may apply to other internal classes as well, e.g.
Entry
,Asset
, etc. Other spellings may also trigger this issue ("ContentType", content_type", etc.). I have not been able to test these.This may be related to the open issue here: #73