def get_fields(self):
        to_update = False
        doc = inspect.getdoc(self.method)
        if not doc and issubclass(self.method.im_class.model, models.Model):
            fields = None
            if self.method.__name__ == 'read':
                fields = self.method.im_class.fields if self.method.im_class.fields else tuple(
                    attr.name for attr in self.method.im_class.model._meta.local_fields)
            elif self.method.__name__ in ('create', 'update'):
                to_update = True
                if hasattr(self.method.im_class, 'form') and \
                        hasattr(self.method.im_class.form, '_meta'):
                    fields = self.method.im_class.form._meta.fields
                else:
                    fields = self.method.im_class.fields
            if fields:
                for field in fields:
                    for mfield in self.method.im_class.model._meta.fields:
                        if mfield.name == field:
                            yield {'name': mfield.name,
                                   'required': not mfield.blank if to_update else False,
                                   'type': get_field_data_type(mfield),
                                   'verbose': mfield.verbose_name,
                                   'help_text': mfield.help_text, }
                            break
dataset/ETHPy150Open treeio/treeio/treeio/core/api/doc.py/HandlerMethod.get_fields/original