Skip to content

Instantly share code, notes, and snippets.

View DariaPlotnikova's full-sized avatar

Daria Plotnikova DariaPlotnikova

  • Novosibirsk
View GitHub Profile
@zacharyvoase
zacharyvoase / lazy_model_loader.py
Created April 6, 2017 02:04
A Lazy Model loader for Django
"""
Do `import lazy_model_loader` as early as possible in your application's
lifecycle, then:
from lazymodels.my_app import MyModel
def some_func():
return MyModel.objects.filter(name='Foo')
We're hacking the Python import system to enable you to import lazy references