Changes between Initial Version and Version 1 of Ticket #31956, comment 18


Ignore:
Timestamp:
Jun 21, 2023, 12:25:45 PM (10 months ago)
Author:
Michael McCartney

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31956, comment 18

    initial v1  
    44
    55{{{
    6 import json
    76import psycopg2
    8 from django.db.backends.signals import connection_created
    97
    108_original_jsonb_function = None
    11 def _handle_jsonb(sender, connection, **kwargs):
     9def _handle_jsonb():
    1210    """
    1311    Workaround for pipeline-altering solution in:
     
    2220    if _original_jsonb_function is None:
    2321        _original_jsonb_function = psycopg2.extras.register_default_jsonb
    24         _original_jsonb_function(globally=True)
     22        # _original_jsonb_function(globally=True, loads=...) if required
    2523        psycopg2.extras.register_default_jsonb = _ignore_command
    2624
     
    3028
    3129    def ready(self):
    32         connection_created.connect(_handle_jsonb)
     30        _handle_jsonb()
    3331}}}
    3432
Back to Top