def changelist_view(self, request, extra_context=None): query_dict = request.GET.copy() if 'q' in query_dict: query_dict['q'] = normalize_text(query_dict['q']) request.GET = query_dict return super(OrganizationAdmin, self).changelist_view(request, extra_context)
def clean_title(self): title = self.cleaned_data['title'] if Organization.objects.exclude(pk=self.instance.pk).filter( norm_title=normalize_text(title)).exists(): raise forms.ValidationError( u'Un Fournisseur ou Acheteur avec ce nom existe déjà.') return title
def clean_title(self): title = self.cleaned_data['title'] norm_title = normalize_text(title) if Organization.objects.filter(norm_title=norm_title).exclude( pk=self.instance.pk).exists(): raise forms.ValidationError( _('An organization with this title already exists.')) return title
def clean_title(self): title = self.cleaned_data['title'] norm_title = normalize_text(title) if Organization.objects.filter(norm_title=norm_title).exclude(pk=self.instance.pk).exists(): raise forms.ValidationError(_('An organization with this title already exists.')) return title
def clean_title(self): title = self.cleaned_data['title'] if Organization.objects.exclude(pk=self.instance.pk).filter(norm_title=normalize_text(title)).exists(): raise forms.ValidationError(u'Un Fournisseur ou Acheteur avec ce nom existe déjà.') return title