Ticket #1367: unique_together.diff

File unique_together.diff, 900 bytes (added by Christopher Lenz <cmlenz@…>, 19 years ago)

Patch for unique_together (against r2314)

  • django/db/models/manipulators.py

     
    66from django.db.models import signals
    77from django.utils.functional import curry
    88from django.utils.datastructures import DotExpandedDict, MultiValueDict
     9from django.utils.text import capfirst
    910import types
    1011
    1112def add_manipulators(sender):
     
    291292            kwargs['%s__pk' % f.name] = field_val
    292293        else:
    293294            kwargs['%s__iexact' % f.name] = field_val
    294     mod = opts.get_model_module()
    295295    try:
    296         old_obj = mod.get_object(**kwargs)
     296        old_obj = self.manager.get(**kwargs)
    297297    except ObjectDoesNotExist:
    298298        return
    299299    if hasattr(self, 'original_object') and self.original_object._get_pk_val() == old_obj._get_pk_val():
Back to Top