<s> from __future__ import absolute_import , unicode_literals <EOL> VERSION = ( <NUM_LIT:1> , <NUM_LIT:11> , <NUM_LIT:4> ) <EOL> __version__ = '<STR_LIT:.>' . join ( map ( str , VERSION ) ) <EOL> class LazySettings ( object ) : <EOL> def _load_settings ( self ) : <EOL> from feincms import default_settings <EOL> from django . conf import settings as django_settings <EOL> for key in dir ( default_settings ) : <EOL> if not key . startswith ( '<STR_LIT>' ) : <EOL> continue <EOL> value = getattr ( default_settings , key ) <EOL> value = getattr ( django_settings , key , value ) <EOL> setattr ( self , key , value ) <EOL> def __getattr__ ( self , attr ) : <EOL> self . _load_settings ( ) <EOL> del self . __class__ . __getattr__ <EOL> return self . __dict__ [ attr ] <EOL> settings = LazySettings ( ) <EOL> COMPLETELY_LOADED = False <EOL> def ensure_completely_loaded ( force = False ) : <EOL> """<STR_LIT>""" <EOL> global COMPLETELY_LOADED <EOL> if COMPLETELY_LOADED and not force : <EOL> return True <EOL> try : <EOL> from django . apps import apps <EOL> except ImportError : <EOL> from django . db . models import loading as apps <EOL> else : <EOL> if not apps . ready : <EOL> return <EOL> import django <EOL> if django . get_version ( ) < '<STR_LIT>' : <EOL> from feincms . _internal import get_models <EOL> for model in get_models ( ) : <EOL> for cache_name in ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) : <EOL> try : <EOL> delattr ( model . _meta , cache_name ) <EOL> except AttributeError : <EOL> pass <EOL> model . _meta . _fill_fields_cache ( ) <EOL> if hasattr ( apps , '<STR_LIT>' ) : <EOL> try : <EOL> apps . cache . get_models . cache_clear ( ) <EOL> except AttributeError : <EOL> apps . cache . _get_models_cache . clear ( ) <EOL> if hasattr ( apps , '<STR_LIT>' ) : <EOL> if apps . ready : <EOL> COMPLETELY_LOADED = True <EOL> elif apps . app_cache_ready ( ) : <EOL> COMPLETELY_LOADED = True <EOL> return True </s>
