mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Refs #24928 -- Added introspection support for PostgreSQL JSONField
Thanks Adam Johnson and Tim Graham for the reviews.
This commit is contained in:
@@ -15,8 +15,12 @@ class PostgresConfig(AppConfig):
|
||||
def ready(self):
|
||||
# Connections may already exist before we are called.
|
||||
for conn in connections.all():
|
||||
if conn.connection is not None:
|
||||
register_type_handlers(conn)
|
||||
if conn.vendor == 'postgresql':
|
||||
conn.introspection.data_types_reverse.update({
|
||||
3802: 'django.contrib.postgresql.fields.JSONField',
|
||||
})
|
||||
if conn.connection is not None:
|
||||
register_type_handlers(conn)
|
||||
connection_created.connect(register_type_handlers)
|
||||
CharField.register_lookup(Unaccent)
|
||||
TextField.register_lookup(Unaccent)
|
||||
|
||||
Reference in New Issue
Block a user