Skip to content

Instantly share code, notes, and snippets.

@hannal
Created November 19, 2016 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannal/568f7277fdf1452890ab1a467f5465bd to your computer and use it in GitHub Desktop.
Save hannal/568f7277fdf1452890ab1a467f5465bd to your computer and use it in GitHub Desktop.
class BaseModel(models.Model):
class Meta:
abstract = True
class A(BaseModel):
pass
class B(BaseModel):
pass
for model in BaseModel.__subclasses__():
do_something()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment