(self, value, expression, connection)
| 84 | return name, path, args, kwargs |
| 85 | |
| 86 | def from_db_value(self, value, expression, connection): |
| 87 | if value is None: |
| 88 | return value |
| 89 | # Some backends (SQLite at least) extract non-string values in their |
| 90 | # SQL datatypes. |
| 91 | if isinstance(expression, KeyTransform) and not isinstance(value, str): |
| 92 | return value |
| 93 | try: |
| 94 | return json.loads(value, cls=self.decoder) |
| 95 | except json.JSONDecodeError: |
| 96 | return value |
| 97 | |
| 98 | def get_internal_type(self): |
| 99 | return "JSONField" |