def get_prep_value(self, value):
if value is not None:
return _JsonAdapter(value, encoder=self.encoder)
return value
# Django 1.11 and above can use the contrib JSONField as it supports
# the encoder kwarg, which means we can use DjangoJSONEncode; 1.10
# and 1.9 must use our hacked together version (which is a direct
# copy+paste from the 1.11 codebase).
评论列表
文章目录