Last active
August 29, 2015 14:09
-
-
Save carymrobbins/f874e339c50646e5dcfb to your computer and use it in GitHub Desktop.
Get Django model by name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get_model_by_name = lambda name: next(m for m in __import__('django').db.models.get_models() if m.__name__ == name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment