You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
562 B

  1. from django.apps import AppConfig
  2. from django.db.backends.signals import connection_created
  3. from django.db.models import CharField, TextField
  4. from django.utils.translation import ugettext_lazy as _
  5. from .lookups import Unaccent
  6. from .signals import register_hstore_handler
  7. class PostgresConfig(AppConfig):
  8. name = 'django.contrib.postgres'
  9. verbose_name = _('PostgreSQL extensions')
  10. def ready(self):
  11. connection_created.connect(register_hstore_handler)
  12. CharField.register_lookup(Unaccent)
  13. TextField.register_lookup(Unaccent)