mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
magic-removal: Got rid of some uses of '_', the special underscore variable, where it's not needed. Trying to solve a weird bug.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2fb5430f3a
commit
50b5f9da63
@ -142,7 +142,7 @@ class AutomaticManipulator(Manipulator):
|
||||
obj_list.sort(lambda x, y: cmp(int(x[0]), int(y[0])))
|
||||
|
||||
# For each related item...
|
||||
for _, rel_new_data in obj_list:
|
||||
for null, rel_new_data in obj_list:
|
||||
|
||||
params = {}
|
||||
|
||||
@ -265,7 +265,7 @@ class ModelChangeManipulator(AutomaticManipulator):
|
||||
# Let the ObjectDoesNotExist exception propogate up.
|
||||
lookup_kwargs = opts.one_to_one_field.rel.limit_choices_to
|
||||
lookup_kwargs['%s__exact' % opts.one_to_one_field.rel.field_name] = obj_key
|
||||
_ = opts.one_to_one_field.rel.to._meta.get_model_module().get_object(**lookup_kwargs)
|
||||
null = opts.one_to_one_field.rel.to._meta.get_model_module().get_object(**lookup_kwargs)
|
||||
params = dict([(f.attname, f.get_default()) for f in opts.fields])
|
||||
params[opts.pk.attname] = obj_key
|
||||
original_object = opts.get_model_module().Klass(**params)
|
||||
|
@ -2,6 +2,7 @@ from django.db import backend, connection
|
||||
from django.db.models.exceptions import *
|
||||
|
||||
LOOKUP_SEPARATOR = '__'
|
||||
|
||||
####################
|
||||
# HELPER FUNCTIONS #
|
||||
####################
|
||||
|
@ -56,13 +56,13 @@ class RelatedObject(object):
|
||||
|
||||
change = count - len(list)
|
||||
if change > 0:
|
||||
return list + [None for _ in range(change)]
|
||||
return list + [None for i in range(change)]
|
||||
if change < 0:
|
||||
return list[:change]
|
||||
else: # Just right
|
||||
return list
|
||||
else:
|
||||
return [None for _ in range(self.field.rel.num_in_admin)]
|
||||
return [None for i in range(self.field.rel.num_in_admin)]
|
||||
|
||||
|
||||
def editable_fields(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user