magic-removal: Spacing change in dispatcher.connect() calls

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-13 04:26:28 +00:00
parent 22260f968c
commit a9297c7a5d
3 changed files with 12 additions and 27 deletions

View File

@ -520,11 +520,7 @@ class FileField(Field):
lambda instance, filename, raw_contents: lambda instance, filename, raw_contents:
instance._save_FIELD_file(self,filename, raw_contents) instance._save_FIELD_file(self,filename, raw_contents)
) )
dispatcher.connect( dispatcher.connect(self.delete_file, signal=signals.post_delete, sender=cls)
self.delete_file,
signal = signals.post_delete,
sender = cls
)
def delete_file(self, instance): def delete_file(self, instance):
if getattr(instance, f.attname): if getattr(instance, f.attname):

View File

@ -1,5 +1,5 @@
from django.db.models import signals from django.db.models import signals
from django.db.models.fields import Field, IntegerField from django.db.models.fields import AutoField, Field, IntegerField
from django.db.models.related import RelatedObject from django.db.models.related import RelatedObject
from django.utils.translation import gettext_lazy, string_concat from django.utils.translation import gettext_lazy, string_concat
from django.utils.functional import curry from django.utils.functional import curry
@ -26,14 +26,10 @@ def do_pending_lookups(sender):
field.rel.to = other_cls field.rel.to = other_cls
field.do_related_class(other_cls, rel_cls) field.do_related_class(other_cls, rel_cls)
dispatcher.connect( dispatcher.connect(do_pending_lookups, signal=signals.class_prepared)
do_pending_lookups,
signal = signals.class_prepared
)
#HACK #HACK
class RelatedField(object): class RelatedField(object):
def contribute_to_class(self, cls, name): def contribute_to_class(self, cls, name):
sup = super(RelatedField, self) sup = super(RelatedField, self)
if hasattr(sup, 'contribute_to_class'): if hasattr(sup, 'contribute_to_class'):
@ -321,11 +317,7 @@ class ManyToManyFieldNew(RelatedField):
#Now we know both classes exist. #Now we know both classes exist.
self.to = cls self.to = cls
# We need to wait until the class we were in was fully defined # We need to wait until the class we were in was fully defined
dispatcher.connect( dispatcher.connect(self.from_prepared, signal=signals.class_prepared, sender=self.from_)
self.from_prepared,
signal = signals.class_prepared,
sender = self.from_
)
def from_prepared(self): def from_prepared(self):
from django.db.models.base import Model from django.db.models.base import Model

View File

@ -14,10 +14,7 @@ def add_manipulators(sender):
cls.add_to_class('AddManipulator', ModelAddManipulator) cls.add_to_class('AddManipulator', ModelAddManipulator)
cls.add_to_class('ChangeManipulator', ModelChangeManipulator) cls.add_to_class('ChangeManipulator', ModelChangeManipulator)
dispatcher.connect( dispatcher.connect(add_manipulators, signal=signals.class_prepared)
add_manipulators,
signal=signals.class_prepared
)
class ManipulatorDescriptor(object): class ManipulatorDescriptor(object):
def __init__(self, name, base): def __init__(self, name, base):