def get_field_kwargs(self, field_name, model_field):
kwargs = {}<EOL>validator_kwarg = list(model_field.validators)<EOL>kwargs['<STR_LIT>'] = model_field<EOL>if model_field.verbose_name and needs_label(model_field, field_name):<EOL><INDENT>kwargs['<STR_LIT:label>'] = capfirst(model_field.verbose_name)<EOL><DEDENT>if model_field.help_text:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.help_text<EOL><DEDENT>max_digits = getattr(model_field, '<STR_LIT>', None)<EOL>if max_digits is not None:<EOL><INDENT>kwargs['<STR_LIT>'] = max_digits<EOL><DEDENT>decimal_places = getattr(model_field, '<STR_LIT>', None)<EOL>if decimal_places is not None:<EOL><INDENT>kwargs['<STR_LIT>'] = decimal_places<EOL><DEDENT>if isinstance(model_field, models.TextField):<EOL><INDENT>kwargs['<STR_LIT>'] = {'<STR_LIT>': '<STR_LIT>'}<EOL><DEDENT>if isinstance(model_field, models.AutoField)or not model_field.editable:<EOL><INDENT>kwargs['<STR_LIT>'] = True<EOL>return kwargs<EOL><DEDENT>if model_field.has_default or model_field.blank or model_field.null:<EOL><INDENT>kwargs['<STR_LIT>'] = False<EOL><DEDENT>if model_field.null and not isinstance(model_field,<EOL>models.NullBooleanField):<EOL><INDENT>kwargs['<STR_LIT>'] = True<EOL><DEDENT>if model_field.blank and (<EOL>isinstance(model_field, models.CharField) or<EOL>isinstance(model_field, models.TextField) or<EOL>isinstance(model_field, columns.Text)<EOL>):<EOL><INDENT>kwargs['<STR_LIT>'] = True<EOL><DEDENT>if isinstance(model_field, models.FilePathField):<EOL><INDENT>kwargs['<STR_LIT:path>'] = model_field.path<EOL>if model_field.match is not None:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.match<EOL><DEDENT>if model_field.recursive is not False:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.recursive<EOL><DEDENT>if model_field.allow_files is not True:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.allow_files<EOL><DEDENT>if model_field.allow_folders is not False:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.allow_folders<EOL><DEDENT><DEDENT>if model_field.choices:<EOL><INDENT>kwargs['<STR_LIT>'] = model_field.choices<EOL>return kwargs<EOL><DEDENT>if isinstance(model_field, models.DecimalField) and DecimalValidator:<EOL><INDENT>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, DecimalValidator)<EOL>]<EOL><DEDENT>max_length = getattr(model_field, '<STR_LIT:max_length>', None)<EOL>if max_length is not None and (<EOL>isinstance(model_field, models.CharField) or<EOL>isinstance(model_field, models.TextField)):<EOL><INDENT>kwargs['<STR_LIT:max_length>'] = max_length<EOL>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, validators.MaxLengthValidator)<EOL>]<EOL><DEDENT>min_length = next((<EOL>validator.limit_value for validator in validator_kwarg<EOL>if isinstance(validator, validators.MinLengthValidator)<EOL>), None)<EOL>if min_length is not None and isinstance(model_field,<EOL>models.CharField):<EOL><INDENT>kwargs['<STR_LIT>'] = min_length<EOL>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, validators.MinLengthValidator)<EOL>]<EOL><DEDENT>max_value = next((<EOL>validator.limit_value for validator in validator_kwarg<EOL>if isinstance(validator, validators.MaxValueValidator)<EOL>), None)<EOL>if max_value is not None and isinstance(model_field,<EOL>NUMERIC_FIELD_TYPES):<EOL><INDENT>kwargs['<STR_LIT>'] = max_value<EOL>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, validators.MaxValueValidator)<EOL>]<EOL><DEDENT>min_value = next((<EOL>validator.limit_value for validator in validator_kwarg<EOL>if isinstance(validator, validators.MinValueValidator)<EOL>), None)<EOL>if min_value is not None and isinstance(model_field,<EOL>NUMERIC_FIELD_TYPES):<EOL><INDENT>kwargs['<STR_LIT>'] = min_value<EOL>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, validators.MinValueValidator)<EOL>]<EOL><DEDENT>if isinstance(model_field, models.URLField):<EOL><INDENT>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if not isinstance(validator, validators.URLValidator)<EOL>]<EOL><DEDENT>if isinstance(model_field, models.EmailField):<EOL><INDENT>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if validator is not validators.validate_email<EOL>]<EOL><DEDENT>if isinstance(model_field, models.SlugField):<EOL><INDENT>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if validator is not validators.validate_slug<EOL>]<EOL><DEDENT>if isinstance(model_field, models.GenericIPAddressField):<EOL><INDENT>validator_kwarg = [<EOL>validator for validator in validator_kwarg<EOL>if validator is not validators.validate_ipv46_address<EOL>]<EOL><DEDENT>if getattr(model_field, '<STR_LIT>', False):<EOL><INDENT>warnings.warn(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>if validator_kwarg:<EOL><INDENT>kwargs['<STR_LIT>'] = validator_kwarg<EOL><DEDENT>return kwargs<EOL>
Creates a default instance of a basic non-relational field.