How do I list all classes of a given type in a python file?
- by Hobhouse
I use django, and have a lengthy models.py file.
class Foo(models.Model):
name = models.CharField()
class Bar(models.Model):
name = models.CharField()
class Fab(models.Model):
name = models.CharField()
Is there a way to make a list of all the classes in the file which are an instance of (models.Model)?