Ticket #7682: 7682.diff

File 7682.diff, 827 bytes (added by Karen Tracey <kmtracey@…>, 16 years ago)
  • django/db/models/fields/__init__.py

     
    326326            params['validator_list'].append(getattr(manipulator, 'isUnique%sFor%s' % (self.name, self.unique_for_month)))
    327327        if self.unique_for_year:
    328328            params['validator_list'].append(getattr(manipulator, 'isUnique%sFor%s' % (self.name, self.unique_for_year)))
    329         if self.unique or (self.primary_key and not rel):
     329        if not rel and (self.unique or self.primary_key):
    330330            params['validator_list'].append(curry(manipulator_validator_unique, self, opts, manipulator))
    331331
    332332        # Only add is_required=True if the field cannot be blank. Primary keys
Back to Top