src/ldt/ldt/__init__.py
author cavaliet
Thu, 28 Nov 2013 10:43:18 +0100
changeset 1260 b3914d0f8c22
parent 1258 79cca551f9d0
child 1262 8fa7934f7838
permissions -rw-r--r--
v1.51.14 debug
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1192
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
     1
__all__ = ["VERSION", "get_version", "__version__"]
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
     2
1260
b3914d0f8c22 v1.51.14 debug
cavaliet
parents: 1258
diff changeset
     3
VERSION = (1, 51, 14, "final", 0)
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
def get_version():
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    version = '%s.%s' % (VERSION[0], VERSION[1])
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    if VERSION[2]:
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
        version = '%s.%s' % (version, VERSION[2])
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    if VERSION[3:] == ('alpha', 0):
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
        version = '%s pre-alpha' % version
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
    else:
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
        if VERSION[3] != 'final':
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
            version = '%s %s %s' % (version, VERSION[3], VERSION[4])
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
    return version
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
__version__ = get_version()
77
7923feb2e362 improve indexation
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    19
1192
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    20
# solve initialization pb
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    21
# The pb comes from the initialization of the middlewares
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    22
# The is a potential circular reference pb between the following modules : security, indexation model.
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    23
# 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
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    24
# This method cause the load of all installed apps, causing the circular dependency problem.
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    25
# the following code force a "pre-load" of all installed app, solving the dependecy pb.
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    26
# TODO: remove this by reworking ldt dependencies
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    27
from django.db.models.loading import get_models
7a8e74f819bc Solve circular dependency problem on loading
ymh <ymh.work@gmail.com>
parents: 1180
diff changeset
    28
_ = get_models()