Example #1
0
 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)
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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)
Example #5
0
 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
Example #6
0
 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