A simple solution:
import django.apps django.apps.apps.get_models()
By default, apps.get_models() does not include
- automatically generated models for many-to-many relationships without an explicit staging table
- models that have been replaced.
If you want to enable them,
django.apps.apps.get_models(include_auto_created=True, include_swapped=True)
Prior to Django 1.7, use:
from django.db import models models.get_models(include_auto_created=True)
The include_auto_created parameter also provides retrieval from tables implicitly created by ManyToManyField .
Daniel Roseman Jul 14 '09 at 15:32 2009-07-14 15:32
source share