Use sqlalchemy customised serializers#6
Conversation
|
This is probably not the right direction. The purpose of serialising is producing something that That was the reason why a known Probably extending |
|
I'm not proposing using a custom serializer for the debugbar, I'm proposing that, when you already are using a custom json serializer with sqlalchemy, the sqlalchemy tab of the debugbar should use that same serializer on the sqlalchemy tab of debugbar instead of (as it happens in our case) just showing "Unable to serialize the query parameters". Why would you want the debugbar to use a different serializer than the app? PS: the decimals situation would not prevent the crash for us because our serializer supports more types other than decimals. |
|
The reason for the debugbar to use a serializer that is not the same as the app is because the debugbar must be able to deserialize for |
This makes tgext.debugbar use customised sqlalchemy json serializers if they are defined in the config.
Fixes #5
Note: I'm not 100% happy with where json_encoder is reading from the config, but that's the place where it worked for me (is_active, enable_sqlalchemy and directly on the original json_encoder definition didn't work with the tg2 app I'm using).