Ticket #15130: using_multidb_for_validate_unique.patch
File using_multidb_for_validate_unique.patch, 1.1 KB (added by , 14 years ago) |
---|
-
.py
old new class Model(object): 799 799 if len(unique_check) != len(lookup_kwargs.keys()): 800 800 continue 801 801 802 qs = model_class._default_manager. filter(**lookup_kwargs)802 qs = model_class._default_manager.using(self._state.db).filter(**lookup_kwargs) 803 803 804 804 # Exclude the current object from the query if we are editing an 805 805 # instance (as opposed to creating a new one) … … class Model(object): 830 830 lookup_kwargs['%s__%s' % (unique_for, lookup_type)] = getattr(date, lookup_type) 831 831 lookup_kwargs[field] = getattr(self, field) 832 832 833 qs = model_class._default_manager. filter(**lookup_kwargs)833 qs = model_class._default_manager.using(self._state.db).filter(**lookup_kwargs) 834 834 # Exclude the current object from the query if we are editing an 835 835 # instance (as opposed to creating a new one) 836 836 if not self._state.adding and self.pk is not None: