Re: register_adapter Json with custom JSONEncoder

2020-07-13 Thread Daniele Varrazzo
Hello, On Mon, 13 Jul 2020 at 16:49, Hans Ginzel wrote: [...] > But I need to use custom JSONEncoder because of bson.ObectId type > # https://stackoverflow.com/a/16586277/2556118 This doc page has more examples: https://www.psycopg.org/docs/extras.html#json-adaptation > There is a parameter d

register_adapter Json with custom JSONEncoder

2020-07-13 Thread Hans Ginzel
Hello, how can I register an adapter with custom JSONEncoder, please. On Stack Overflow, https://stackoverflow.com/a/55939024/2556118 I have found to use Json class psycopg2.extensions.register_adapter(dict, psycopg2.extras.Json). But I need to use custom JSONEncoder because of bson.ObectId typ