equal
deleted
inserted
replaced
365 for rtype in rtypes: |
365 for rtype in rtypes: |
366 rtypes_msg[rtype] = _('%s is part of violated unicity constraint') % rtype |
366 rtypes_msg[rtype] = _('%s is part of violated unicity constraint') % rtype |
367 globalmsg = _('some relations violate a unicity constraint') |
367 globalmsg = _('some relations violate a unicity constraint') |
368 rtypes_msg['unicity constraint'] = globalmsg |
368 rtypes_msg['unicity constraint'] = globalmsg |
369 raise ValidationError(self.entity.eid, rtypes_msg) |
369 raise ValidationError(self.entity.eid, rtypes_msg) |
370 |
|
371 # deprecated ################################################################### |
|
372 |
|
373 |
|
374 class adapter_deprecated(view.auto_unwrap_bw_compat): |
|
375 """metaclass to print a warning on instantiation of a deprecated class""" |
|
376 |
|
377 def __call__(cls, *args, **kwargs): |
|
378 msg = getattr(cls, "__deprecation_warning__", |
|
379 "%(cls)s is deprecated") % {'cls': cls.__name__} |
|
380 warn(msg, DeprecationWarning, stacklevel=2) |
|
381 return type.__call__(cls, *args, **kwargs) |
|