class OmgAdminForm(forms.ModelForm):
def clean_name(self):
if self.value == 'search':
raise ValueError(
'You have mistake')
return self.cleaned_data['name']
@admin.register(Omg)
class OmgAdmin(admin.ModelAdmin):
list_display = ('fox',)
form = OmgAdminForm