apps.py 697 B

1234567891011121314151617181920
  1. from django.apps import AppConfig
  2. from django.db import models
  3. from django.db.migrations.operations import AlterModelOptions
  4. from utilities.migration import custom_deconstruct
  5. # Ignore verbose_name & verbose_name_plural Meta options when calculating model migrations
  6. AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name')
  7. AlterModelOptions.ALTER_OPTION_KEYS.remove('verbose_name_plural')
  8. # Use our custom destructor to ignore certain attributes when calculating field migrations
  9. models.Field.deconstruct = custom_deconstruct
  10. class CoreConfig(AppConfig):
  11. name = "core"
  12. def ready(self):
  13. from . import data_backends, search
  14. from core.api import schema # noqa: E402