# HG changeset patch # User ymh # Date 1369149625 -7200 # Node ID 7a8e74f819bc55e2984e814d3304c3546e7cdfd9 # Parent b6e0b181172309b2c128637ddbb84911b506e8b6 Solve circular dependency problem on loading diff -r b6e0b1811723 -r 7a8e74f819bc src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Mon May 20 18:02:37 2013 +0200 +++ b/src/ldt/ldt/__init__.py Tue May 21 17:20:25 2013 +0200 @@ -1,3 +1,5 @@ +__all__ = ["VERSION", "get_version", "__version__"] + VERSION = (1, 49, 0, "final", 0) @@ -15,3 +17,12 @@ __version__ = get_version() +# solve initialization pb +# The pb comes from the initialization of the middlewares +# The is a potential circular reference pb between the following modules : security, indexation model. +# the cause comes from the fact that at one moment, the User model is referenced, using the new django 1.5 django.contrib.auth.get_user_model method +# This method cause the load of all installed apps, causing the circular dependency problem. +# the following code force a "pre-load" of all installed app, solving the dependecy pb. +# TODO: remove this by reworking ldt dependencies +from django.db.models.loading import get_models +_ = get_models()