PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  ]c@sddlZddlZddlZddlmZmZmZddlmZddl m Z m Z ddl m Z ddlmZdefd YZed eZdS( iN(tCountert OrderedDictt defaultdict(tpartial(tAppRegistryNotReadytImproperlyConfigured(t lru_cachei(t AppConfigtAppscBseZdZddZddZdZdZdZdZ e j dde e dZ de d Zd Zd Zd Zd Ze j dddZdZdZdZdZdZdZdZRS(s A registry that stores the configuration of installed applications. It also keeps track of models eg. to provide reverse-relations. cCs|dkr1ttjtdr1tdntt|_t|_ g|_ t |_ |_ |_tj|_tt|_|dk r|j|ndS(Ntappss+You must supply an installed_apps argument.(tNonethasattrtsystmodulest__name__t RuntimeErrorRRt all_modelst app_configststored_app_configstFalset apps_readyt models_readytreadyt threadingtLockt_locktlistt_pending_operationstpopulate(tselftinstalled_apps((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyt__init__s"    cCs|jr dS|j|jr$dS|jr<tdnxv|D]n}t|tra|}ntj|}|j|jkrtd|jn||j|j<||_ qCWt d|jj D}g|j D]\}}|dkr|^q}|r'tddj |nt|_x!|jj D]}|jq@W|jt|_x|jD]}|jqtWt|_WdQXdS(s Loads application configurations and models. This method imports each application module and then each model module. It is thread safe and idempotent, but not reentrant. Nspopulate() isn't reentrants0Application labels aren't unique, duplicates: %scss|]}|jVqdS(N(tname(t.0t app_config((s8/usr/lib/python2.7/site-packages/django/apps/registry.pys `sis/Application names aren't unique, duplicates: %ss, (RRRRt isinstanceRtcreatetlabelRR Rtvaluest most_commontjointTrueRt import_modelst clear_cacheRtget_app_configs(RRtentryR"tcountsR tcountt duplicates((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyR:s@       1   cCs|jstdndS(sL Raises an exception if all apps haven't been imported yet. sApps aren't loaded yet.N(RR(R((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytcheck_apps_readyxs cCs|jstdndS(sN Raises an exception if all models haven't been imported yet. sModels aren't loaded yet.N(RR(R((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytcheck_models_readys cCs|j|jjS(sN Imports applications and returns an iterable of app configs. (R1RR&(R((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyR,s cCs|jy|j|SWnbtk r}d|}x8|jD]*}|j|kr@|d|j7}Pq@q@Wt|nXdS(s Imports applications and returns an app config for the given label. Raises LookupError if no application exists with this label. s!No installed app with label '%s'.s Did you mean '%s'?N(R1RtKeyErrorR,R R%t LookupError(Rt app_labeltmessageR"((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytget_app_configs   tmaxsizecCsM|jg}x6|jjD]%}|jt|j||q W|S(s] Returns a list of all installed models. By default, the following models aren't included: - auto-created models for many-to-many relations without an explicit intermediate table, - models that have been swapped out. Set the corresponding keyword argument to True to include such models. (R2RR&textendRt get_models(Rtinclude_auto_createdtinclude_swappedtresultR"((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyR:s #cCs|r|jn |j|dkrA|jd\}}n|j|}| rs|jdkrs|jn|j|d|S(s Returns the model matching the given app_label and model_name. As a shortcut, this function also accepts a single argument in the form .. model_name is case-insensitive. Raises LookupError if no application exists with this label, or no model exists with this name in the application. Raises ValueError if called with a single argument that doesn't contain exactly one dot. t.t require_readyN(R2R1R tsplitR7tmodelsR*t get_model(RR5t model_nameR?R"((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyRBs     cCs|jj}|j|}||kr|j||jkrt|j||jkrttjd||ftddqtd|||||fn|||<|j ||j dS(NsModel '%s.%s' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.t stacklevelis7Conflicting '%s' models in application '%s': %s and %s.( t_metaRCRRt __module__twarningstwarntRuntimeWarningRtdo_pending_operationsR+(RR5tmodelRCt app_models((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytregister_models      cs-|jtfd|jjDS(s Checks whether an application with this name exists in the registry. app_name is the full name of the app eg. 'django.contrib.admin'. c3s|]}|jkVqdS(N(R (R!tac(tapp_name(s8/usr/lib/python2.7/site-packages/django/apps/registry.pys s(R1tanyRR&(RRO((ROs8/usr/lib/python2.7/site-packages/django/apps/registry.pyt is_installeds cCs|jg}xk|jjD]Z}|j|jr |t|j}|dksg|ddkrz|j|qzq q W|rt|dddSdS(s Look for an app config containing a given object. object_name is the dotted Python path to the object. Returns the app config for the inner application in case of nesting. Returns None if the object isn't in any registered app config. tiR>tkeycSst|j S(N(tlenR (RN((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytsN(R1RR&t startswithR RTtappendtsorted(Rt object_namet candidatesR"tsubpath((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytget_containing_app_configs cCsE|j|j|j}|dkrAtd||fn|S(s Similar to get_model(), but doesn't require that an app exists with the given app_label. It's safe to call this method at import time, even while the registry is being populated. sModel '%s.%s' not registered.N(RtgettlowerR R4(RR5RCRK((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytget_registered_models  cCsqxj|jdtD]V}|jj}|rA||krA|jjS|jjr|jj|kr|jjSqWdS(s For a given model string (e.g. "auth.User"), return the name of the corresponding settings name if it refers to a swappable model. If the referred model is not swappable, return None. This method is decorated with lru_cache because it's performance critical when it comes to migrations. Since the swappable settings don't change after Django has loaded the settings, there is no reason to get the respective settings attribute over and over again. R<N(R:R)REtswappedt swappableR%R (Rt to_stringRKR`((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytget_swappable_settings_names   csttd|jD}j|sWtddj|n|jj|jtfd|jj D|_|j dS(su Restricts the set of installed apps used by get_app_config[s]. available must be an iterable of application names. set_available_apps() must be balanced with unset_available_apps(). Primarily used for performance optimization in TransactionTestCase. This method is safe is the sense that it doesn't trigger any imports. css|]}|jVqdS(N(R (R!R"((s8/usr/lib/python2.7/site-packages/django/apps/registry.pys 2ss?Available apps isn't a subset of installed apps, extra apps: %ss, c3s0|]&\}}|jkr||fVqdS(N(R (R!R%R"(t available(s8/usr/lib/python2.7/site-packages/django/apps/registry.pys ;s N( tsetR,tissubsett ValueErrorR(RRWRRtitemsR+(RRdt installed((Rds8/usr/lib/python2.7/site-packages/django/apps/registry.pytset_available_apps%s  cCs |jj|_|jdS(sB Cancels a previous call to set_available_apps(). N(RtpopRR+(R((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytunset_available_apps@scCsi|jstdn|jj|jt|_t|_|_|_|j |j |dS(s Enables a different set of installed apps for get_app_config[s]. installed must be an iterable in the same format as INSTALLED_APPS. set_installed_apps() must be balanced with unset_installed_apps(), even if it exits with an exception. Primarily used as a receiver of the setting_changed signal in tests. This method may trigger new imports, which may add new models to the registry of all imported models. They will stay in the registry even after unset_installed_apps(). Since it isn't possible to replay imports safely (eg. that could lead to registering listeners twice), models are registered when they're imported and never removed. sApp registry isn't ready yet.N( RRRRWRRRRRR+R(RRi((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytset_installed_appsGs   cCs7|jj|_t|_|_|_|jdS(sB Cancels a previous call to set_installed_apps(). N(RRkRR)RRRR+(R((s8/usr/lib/python2.7/site-packages/django/apps/registry.pytunset_installed_apps`scCsa|jj|jr]xD|jjD]0}x'|jdtD]}|jjq?Wq&WndS(s} Clears all internal caches, for methods that alter the app registry. This is mostly used in tests. R;N(R:t cache_clearRRR&R)REt _expire_cache(RR"RK((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyR+hs   cs|s|nx|d|d}fd|_yj|}Wn%tk r}j|jn X|dS(s` Take a function and a number of ("app_label", "modelname") tuples, and when all the corresponding models have been imported and registered, call the function with the model classes as its arguments. The function passed to this method must accept exactly n models as arguments, where n=len(model_keys). iics&tj|}j|dS(N(Rtfunctlazy_model_operation(RKt next_function(tapply_next_modelt more_modelsR(s8/usr/lib/python2.7/site-packages/django/apps/registry.pyRtsN(RqR_R4RRW(Rtfunctiont model_keyst next_modelt model_class((RtRuRs8/usr/lib/python2.7/site-packages/django/apps/registry.pyRrxs    cCsF|jj|jjf}x'|jj|gD]}||q.WdS(s Take a newly-prepared model and pass it to each function waiting for it. This is called at the very end of `Apps.register_model()`. N(RER5RCRRk(RRKRSRv((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyRJs(N(RRFt__doc__RR RR1R2R,R7RRR:R)RBRMRQR\R_RcRjRlRmRnR+RrRJ(((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyR s, & >             'R(R RRGt collectionsRRRt functoolsRtdjango.core.exceptionsRRt django.utilsRtconfigRtobjectRR R (((s8/usr/lib/python2.7/site-packages/django/apps/registry.pyts