code: def get_name(cls):
          
          if not hasattr(cls.Meta, 'name'):
              class_name = getattr(cls.get_model(), '__name__', None)
              setattr(
                  cls.Meta,
                  'name',
                  inflection.underscore(class_name) if class_name else None
              )
  
          return cls.Meta.name
docs: Get the serializer name.
  
          The name can be defined on the Meta class or will be generated
          automatically from the model name.