parameters: (self, **kwargs)
return_statement: return inlineformset_factory(self.parent_model, self.model, **defaults)
docstring: 返回 BaseInlineFormSet 类
docstring_summary: 返回 BaseInlineFormSet 类
docstring_tokens: 返回 BaseInlineFormSet 类
function: def get_formset(self, **kwargs):
          """返回 BaseInlineFormSet 类"""
          if self.exclude is None:
              exclude = []
          else:
              exclude = list(self.exclude)
          exclude.extend(self.get_readonly_fields())
          if self.exclude is None and hasattr(self.form, '_meta') and self.form._meta.exclude:
              # Take the custom ModelForm's Meta.exclude into account only if the
              # InlineModelAdmin doesn't define its own.
              exclude.extend(self.form._meta.exclude)
          # if exclude is an empty list we use None, since that's the actual
          # default
          #exclude = exclude or None
          can_delete = self.can_delete and self.has_delete_permission()
          defaults = {
              "form": self.form,
              "formset": self.formset,
              "fk_name": self.fk_name,
              "exclude": exclude,
              "formfield_callback": self.formfield_for_dbfield,
              "extra": self.extra,
              "max_num": self.max_num,
              "can_delete": can_delete,
          }
          defaults.update(kwargs)
          return inlineformset_factory(self.parent_model, self.model, **defaults)
function_tokens: def get_formset ( self , * * kwargs ) : if self . exclude is None : exclude = [ ] else : exclude = list ( self . exclude ) exclude . extend ( self . get_readonly_fields ( ) ) if self . exclude is None and hasattr ( self . form , '_meta' ) and self . form . _meta . exclude : # Take the custom ModelForm's Meta.exclude into account only if the # InlineModelAdmin doesn't define its own. exclude . extend ( self . form . _meta . exclude ) # if exclude is an empty list we use None, since that's the actual # default #exclude = exclude or None can_delete = self . can_delete and self . has_delete_permission ( ) defaults = { "form" : self . form , "formset" : self . formset , "fk_name" : self . fk_name , "exclude" : exclude , "formfield_callback" : self . formfield_for_dbfield , "extra" : self . extra , "max_num" : self . max_num , "can_delete" : can_delete , } defaults . update ( kwargs ) return inlineformset_factory ( self . parent_model , self . model , * * defaults )