diff options
author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-26 13:30:48 +0000 |
---|---|---|
committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-26 13:30:48 +0000 |
commit | 439cb4047fb583d08149f28e2ce66a8edfe0efa7 (patch) | |
tree | 47ef30e70bf1d757f08b133d3aa47704db13c714 /django/db/models/options.py | |
parent | 6c02565e4fb92c4cc3bfb45bcc89eb9aa299efdc (diff) | |
download | django-439cb4047fb583d08149f28e2ce66a8edfe0efa7.tar.gz |
Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
improvement and forward-compatible with future Python releases. Patch from Gary
Wilson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/options.py')
-rw-r--r-- | django/db/models/options.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index 51cf0a019b..dd6c586ddd 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -140,7 +140,7 @@ class Options(object): def get_follow(self, override=None): follow = {} for f in self.fields + self.many_to_many + self.get_all_related_objects(): - if override and override.has_key(f.name): + if override and f.name in override: child_override = override[f.name] else: child_override = None @@ -182,7 +182,7 @@ class Options(object): # TODO: follow if not hasattr(self, '_field_types'): self._field_types = {} - if not self._field_types.has_key(field_type): + if field_type not in self._field_types: try: # First check self.fields. for f in self.fields: |