Django

Code

Changeset 4936

Show
Ignore:
Timestamp:
04/05/07 13:36:04 (1 year ago)
Author:
ubernostrum
Message:

0.91-bugfixes: fix lookup kwarg corruption in certain types of one-to-one listings. Thanks Tom Tobin for finally figuring this one out

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/0.91-bugfixes/django/core/meta/__init__.py

    r4673 r4936  
    17351735                # For example, make sure the Place exists for the Restaurant. 
    17361736                # Let the ObjectDoesNotExist exception propagate up. 
    1737                 lookup_kwargs = opts.one_to_one_field.rel.limit_choices_to 
     1737                lookup_kwargs = opts.one_to_one_field.rel.limit_choices_to.copy() 
    17381738                lookup_kwargs['%s__exact' % opts.one_to_one_field.rel.field_name] = obj_key 
    17391739                _ = opts.one_to_one_field.rel.to.get_model_module().get_object(**lookup_kwargs)