Django

Code

Show
Ignore:
Timestamp:
08/06/08 10:32:46 (5 months ago)
Author:
jacob
Message:

Major refactoring of django.dispatch with an eye towards speed. The net result is that signals are up to 90% faster.

Though some attempts and backwards-compatibility were made, speed trumped compatibility. Thus, as usual, check BackwardsIncompatibleChanges for the complete list of backwards-incompatible changes.

Thanks to Jeremy Dunck and Keith Busell for the bulk of the work; some ideas from Brian Herring's previous work (refs #4561) were incorporated.

Documentation is, sigh, still forthcoming.

Fixes #6814 and #3951 (with the new dispatch_uid argument to connect).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/contenttypes/management.py

    r6287 r8223  
    11from django.contrib.contenttypes.models import ContentType 
    2 from django.dispatch import dispatcher 
    32from django.db.models import get_apps, get_models, signals 
    43from django.utils.encoding import smart_unicode 
    54 
    6 def update_contenttypes(app, created_models, verbosity=2): 
     5def update_contenttypes(app, created_models, verbosity=2, **kwargs): 
    76    """ 
    87    Creates content types for models in the given app, removing any model 
     
    3837        update_contenttypes(app, None, verbosity) 
    3938 
    40 dispatcher.connect(update_contenttypes, signal=signals.post_syncdb
     39signals.post_syncdb.connect(update_contenttypes
    4140 
    4241if __name__ == "__main__":