Ticket #7353: correct-field-lookup.patch

File correct-field-lookup.patch, 686 bytes (added by m.gajda@…, 16 years ago)
  • django/db/models/manipulators.py

     
    282286    from django.utils.text import get_text_list
    283287    field_list = [opts.get_field(field_name) for field_name in field_name_list]
    284288    if isinstance(field_list[0].rel, ManyToOneRel):
    285         kwargs = {'%s__%s__iexact' % (field_name_list[0], field_list[0].rel.field_name): field_data}
     289        kwargs = {'%s__pk' % field_name_list[0]: field_data}
    286290    else:
    287291        kwargs = {'%s__iexact' % field_name_list[0]: field_data}
    288292    for f in field_list[1:]:
Back to Top