code: def get_relation_kwargs(field_name, relation_info):
      
      model_field, related_model, to_many, to_field, has_through_model = relation_info
      kwargs = {
          'queryset': related_model._default_manager,
          'view_name': get_detail_view_name(related_model)
      }
  
      if to_many:
          kwargs['many'] = True
  
      if to_field:
          kwargs['to_field'] = to_field
  
      if has_through_model:
          kwargs['read_only'] = True
          kwargs.pop('queryset', None)
  
      if model_field:
          if model_field.verbose_name and needs_label(model_field, field_name):
              kwargs['label'] = capfirst(model_field.verbose_name)
          help_text = model_field.help_text
          if help_text:
              kwargs['help_text'] = help_text
          if not model_field.editable:
              kwargs['read_only'] = True
              kwargs.pop('queryset', None)
          if kwargs.get('read_only', False):
              # If this field is read-only, then return early.
              # No further keyword arguments are valid.
              return kwargs
  
          if model_field.has_default() or model_field.blank or model_field.null:
              kwargs['required'] = False
          if model_field.null:
              kwargs['allow_null'] = True
          if model_field.validators:
              kwargs['validators'] = model_field.validators
          if getattr(model_field, 'unique', False):
              validator = UniqueValidator(queryset=model_field.model._default_manager)
              kwargs['validators'] = kwargs.get('validators', []) + [validator]
          if to_many and not model_field.blank:
              kwargs['allow_empty'] = False
  
      return kwargs
docs: Creates a default instance of a flat relational field.