Closed lpil closed 2 years ago
Hello!
With the latest version JSONField has these properties:
encoder: json.JSONEncoder = ... decoder: json.JSONEncoder = ...
However the Django documentation seems to say it should be the class constructor that is given, not an instance of the encoder class. This also seems to be what I've found in our codebase, both in hand written and generated code.
https://docs.djangoproject.com/en/3.2/ref/models/fields/#jsonfield
Should these fields be of this type?
encoder: Callable[[], json.JSONEncoder] = ... decoder: Callable[[], json.JSONEncoder] = ...
Thanks
Oh yeah that makes sense
I think another way to write that is Type[json.JSONEncoder]
Type[json.JSONEncoder]
Hello!
With the latest version JSONField has these properties:
However the Django documentation seems to say it should be the class constructor that is given, not an instance of the encoder class. This also seems to be what I've found in our codebase, both in hand written and generated code.
https://docs.djangoproject.com/en/3.2/ref/models/fields/#jsonfield
Should these fields be of this type?
Thanks