From 34a3bd52255a2253696b74b2d76133aace839fd2 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 6 Aug 2008 15:32:46 +0000 Subject: 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). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8223 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/query.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'django/db/models/sql/query.py') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 18dd8cc3f2..b5e99fb4c0 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -11,7 +11,6 @@ from copy import deepcopy from django.utils.tree import Node from django.utils.datastructures import SortedDict -from django.dispatch import dispatcher from django.db import connection from django.db.models import signals from django.db.models.fields import FieldDoesNotExist @@ -1670,7 +1669,7 @@ def order_modified_iter(cursor, trim, sentinel): sentinel): yield [r[:-trim] for r in rows] -def setup_join_cache(sender): +def setup_join_cache(sender, **kwargs): """ The information needed to join between model fields is something that is invariant over the life of the model, so we cache it in the model's Options @@ -1680,5 +1679,5 @@ def setup_join_cache(sender): """ sender._meta._join_cache = {} -dispatcher.connect(setup_join_cache, signal=signals.class_prepared) +signals.class_prepared.connect(setup_join_cache) -- cgit v1.3