Ticket #3938: 0.91-onetoone-admin-changelist-fix.patch

File 0.91-onetoone-admin-changelist-fix.patch, 878 bytes (added by Tom Tobin <korpios@…>, 18 years ago)

fix for Ticket #3938 (admin view bug with one-to-one models)

  • django/core/meta/__init__.py

     
    17341734                # Sanity check -- Make sure the "parent" object exists.
    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)
    17401740                params = dict([(f.attname, f.get_default()) for f in opts.fields])
Back to Top