def validate_ml_unique(self):
        form_errors = []
        
        if not hasattr(self.instance._meta, 'translation_model'):
            return
        for check in self.instance._meta.translation_model._meta.unique_together[:]:
            lookup_kwargs = {'language_code': GLL.language_code}
            for field_name in check:
                #local_name = "%s_%s" % (field_name, self.use_language)
                if self.cleaned_data.get(field_name) is not None:
                    lookup_kwargs[field_name] = self.cleaned_data.get(field_name) 
            
            if len(check) == 2 and 'master' in check and 'language_code' in check:
                continue
                
            qs = self.instance._meta.translation_model.objects.filter(**lookup_kwargs)
            if self.instance.pk is not None:
                qs = qs.exclude(master=self.instance.pk)
            
            if qs.count():
                model_name = capfirst(self.instance._meta.verbose_name)
                field_labels = []
                for field_name in check:
                    if field_name == "language_code":
                        field_labels.append(_("language"))
                    elif field_name == "master":
                        continue
                    else:
                        field_labels.append(self.instance._meta.translation_model._meta.get_field_by_name(field_name)[0].verbose_name)
                field_labels = get_text_list(field_labels, _('and'))
                form_errors.append(
                    _(u"%(model_name)s with this %(field_label)s already exists.") % \
                    {'model_name': unicode(model_name),
                     'field_label': unicode(field_labels)}
                )
        if form_errors:
            # Raise the unique together errors since they are considered
            # form-wide.
            raise ValidationError(form_errors)
dataset/ETHPy150Open hzlf/openbroadcast/website/multilingual/admin.py/MultilingualModelAdminForm.validate_ml_unique/original