code: def model_file_fields(self, model):
          
          for field in model._meta.fields:
              if isinstance(field, models.FileField):
                  yield field
docs: Generator yielding all instances of FileField and its subclasses of a model.