MCPcopy Create free account
hub / github.com/django-commons/django-debug-toolbar / _binary_object_hook

Function _binary_object_hook

debug_toolbar/store.py:34–49  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

32
33
34def _binary_object_hook(obj):
35 if BINARY_SENTINEL in obj:
36 return base64.b64decode(obj[BINARY_SENTINEL])
37 if POSTGIS_SENTINEL in obj:
38 ewkb = base64.b64decode(obj[POSTGIS_SENTINEL])
39 try:
40 from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
41
42 adapter = PostGISAdapter.__new__(PostGISAdapter)
43 adapter.is_geometry = obj.get("is_geometry", True)
44 adapter.ewkb = ewkb
45 adapter.geography = obj.get("geography", False)
46 return adapter
47 except (ImportError, ImproperlyConfigured):
48 return ewkb
49 return obj
50
51
52class DebugToolbarJSONDecoder(json.JSONDecoder):

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…