Django Obtenha todos os campos modelo
def get_model_fields(model):
return model._meta.fields
Confused Cowfish
def get_model_fields(model):
return model._meta.fields
import django.apps
django.apps.apps.get_models() #uses django lib to show models in your Django App
#Sample Output:
[django.contrib.admin.models.LogEntry,
django.contrib.auth.models.Permission,
django.contrib.auth.models.Group,
django.contrib.auth.models.User,
django.contrib.contenttypes.models.ContentType,
django.contrib.sessions.models.Session,
myApp.models.myModel]