code: def formfield(self, **kwargs):
          
  
          defaults = {
              'form_class': forms.CharField,
              'required': False
          }
  
          defaults.update(kwargs)
  
          form_field = super().formfield(**defaults)
          form_field.widget = forms.HiddenInput()
  
          return form_field
docs: Gets the form field associated with this field.
  
          Because this is a slug field which is automatically
          populated, it should be hidden from the form.