About Getting a List of Textual Fields of a Model Instance
To get a list of textual fields of any model instance, you can do this:
from django.db import models
text_field_names = [
field.name
for field in type(instance)._meta.get_fields()
if isinstance(field, (models.CharField, models.TextField))
]
Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You