Ticket #7538: django_models_loaded_signal.patch

File django_models_loaded_signal.patch, 1.1 KB (added by django@…, 16 years ago)

adds models_loaded signal

  • db/models/loading.py

     
    33from django.conf import settings
    44from django.core.exceptions import ImproperlyConfigured
    55from django.utils.datastructures import SortedDict
     6from django.db.models import signals
     7from django.dispatch import dispatcher
    68
    79import sys
    810import os
     
    6163                self.loaded = True
    6264        finally:
    6365            self.write_lock.release()
     66        dispatcher.send(signal=signals.models_loaded)
    6467
    6568    def load_app(self, app_name, can_postpone=False):
    6669        """
     
    187190register_models = cache.register_models
    188191load_app = cache.load_app
    189192app_cache_ready = cache.app_cache_ready
     193
  • db/models/signals.py

     
    1010post_delete = object()
    1111
    1212post_syncdb = object()
     13
     14models_loaded = object()
Back to Top