Loading AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,7 @@ answer newbie questions, and generally made Django that much better: Terry Huang <terryh.tp@gmail.com> thebjorn <bp@datakortet.no> Thejaswi Puthraya <thejaswi.puthraya@gmail.com> Thomas Chaumeny <t.chaumeny@gmail.com> Thomas Güttler <hv@tbz-pariv.de> Thomas Kerpe <thomas@kerpe.net> Thomas Sorrel Loading django/contrib/postgres/apps.py +4 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.db.backends.signals import connection_created from django.db.models import CharField, TextField from django.utils.translation import ugettext_lazy as _ from .lookups import Unaccent from .signals import register_hstore_handler Loading @@ -11,3 +13,5 @@ class PostgresConfig(AppConfig): def ready(self): connection_created.connect(register_hstore_handler) CharField.register_lookup(Unaccent) TextField.register_lookup(Unaccent) django/contrib/postgres/lookups.py 0 → 100644 +10 −0 Original line number Diff line number Diff line from django.db.models import Transform class Unaccent(Transform): bilateral = True lookup_name = 'unaccent' def as_postgresql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) return "UNACCENT(%s)" % lhs, params django/contrib/postgres/operations.py +6 −0 Original line number Diff line number Diff line Loading @@ -32,3 +32,9 @@ class HStoreExtension(CreateExtension): # extension is installed, a subsequent data migration would use the # same connection register_hstore_handler(schema_editor.connection) class UnaccentExtension(CreateExtension): def __init__(self): self.name = 'unaccent' docs/ref/contrib/postgres/index.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ a number of PostgreSQL specific data types. fields forms lookups operations validators Loading
AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,7 @@ answer newbie questions, and generally made Django that much better: Terry Huang <terryh.tp@gmail.com> thebjorn <bp@datakortet.no> Thejaswi Puthraya <thejaswi.puthraya@gmail.com> Thomas Chaumeny <t.chaumeny@gmail.com> Thomas Güttler <hv@tbz-pariv.de> Thomas Kerpe <thomas@kerpe.net> Thomas Sorrel Loading
django/contrib/postgres/apps.py +4 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.db.backends.signals import connection_created from django.db.models import CharField, TextField from django.utils.translation import ugettext_lazy as _ from .lookups import Unaccent from .signals import register_hstore_handler Loading @@ -11,3 +13,5 @@ class PostgresConfig(AppConfig): def ready(self): connection_created.connect(register_hstore_handler) CharField.register_lookup(Unaccent) TextField.register_lookup(Unaccent)
django/contrib/postgres/lookups.py 0 → 100644 +10 −0 Original line number Diff line number Diff line from django.db.models import Transform class Unaccent(Transform): bilateral = True lookup_name = 'unaccent' def as_postgresql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) return "UNACCENT(%s)" % lhs, params
django/contrib/postgres/operations.py +6 −0 Original line number Diff line number Diff line Loading @@ -32,3 +32,9 @@ class HStoreExtension(CreateExtension): # extension is installed, a subsequent data migration would use the # same connection register_hstore_handler(schema_editor.connection) class UnaccentExtension(CreateExtension): def __init__(self): self.name = 'unaccent'
docs/ref/contrib/postgres/index.txt +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ a number of PostgreSQL specific data types. fields forms lookups operations validators