
    h,                     d    S SK r S SKrS SKJr  S SKJr  S SKJr  S SKJ	r	J
r
  SrSr " S S	5      rg)
    N)import_module)ImproperlyConfigured)cached_property)import_stringmodule_has_submoduleappsmodelsc                   z    \ rS rSrSrS rS r\S 5       r\	S 5       r
S r\S 5       rSS	 jrSS
 jrS rS rSrg)	AppConfig   z>Class representing a Django application and its configuration.c                    Xl         X l        S U l        [        U S5      (       d  UR	                  S5      S   U l        U R
                  R                  5       (       d  [        SU R
                  -  5      e[        U S5      (       d  U R
                  R                  5       U l	        [        U S5      (       d  U R                  U5      U l        S U l        S U l        g )Nlabel.   z4The app label '%s' is not a valid Python identifier.verbose_namepath)namemoduler   hasattr
rpartitionr   isidentifierr   titler   _path_from_moduler   models_moduler	   )selfapp_name
app_modules      D/var/www/html/env/lib/python3.13/site-packages/django/apps/config.py__init__AppConfig.__init__   s    	 ! 	 tW%%!,,S1!4DJzz&&((&FS 
 t^,, $

 0 0 2D tV$$..z:DI
 "     c                 T    SU R                   R                  < SU R                  < S3$ )N<z: >)	__class____name__r   r   s    r   __repr__AppConfig.__repr__:   s    !^^44djjAAr!   c                 &    SSK Jn  UR                  $ )Nr   )settings)django.confr+   DEFAULT_AUTO_FIELD)r   r+   s     r   default_auto_fieldAppConfig.default_auto_field=   s    (***r!   c                 N    U R                   R                  [        R                  L$ )N)r%   r.   r   r'   s    r   !_is_default_auto_field_overridden+AppConfig._is_default_auto_field_overriddenC   s    ~~00	8T8TTTr!   c                 P   [        [        US/ 5      5      n[        U5      S:w  aE  [        USS5      nUb!  [        R                  R                  U5      /nO[        [        U5      5      n[        U5      S:  a  [        SU< SU< S35      eU(       d  [        SU-  5      eUS	   $ )
z;Attempt to determine app's filesystem path from its module.__path__   __file__NzThe app module z$ has multiple filesystem locations (zX); you must configure this app with an AppConfig subclass with a 'path' class attribute.zThe app module %r has no filesystem location, you must configure this app with an AppConfig subclass with a 'path' class attribute.r   )listgetattrlenosr   dirnamesetr   )r   r   pathsfilenames       r   r   AppConfig._path_from_moduleG   s    
 WVZ45u:?vz48H#23 SZ(u:>& 5;EC 
 &139: 
 Qxr!   c           
      6   SnSnSn [        U5      n[        U[        5      (       Ga(  U< S[        < 3n[        U5      n[        R                  " U[        R
                  5       VVs/ s H4  u  px[        X5      (       d  M  XLd  M  [        USS5      (       d  M1  Xx4PM6     n	nn[        U	5      S:X  a	  U	S   S   nOU	 VVs/ s H  u  px[        USS5      (       d  M  Xx4PM     n	nn[        U	5      S:  aA  U	 VV
s/ s H  u  pz[        U5      PM     nnn
[        U< SS	R                  U5      < S35      e[        U	5      S:X  a  U	S   S   nUc  U nUnUc   [        U5      nUc  Uc  UR                  S5      u  pZnU(       a  US   R                  5       (       a  [        U5      n[        R                  " U[        R
                  5       VVs/ s H(  u  px[        X5      (       d  M  XLd  M  [        U5      PM*     nnnS
U< SU< S3nU(       a  USS	R                  U5      -  -  n[!        U5      e[        U5        [        U["        5      (       d  [%        SU-  5      eUc   UR&                  n [        U5      nU" X45      $ s  snnf s  snnf s  sn
nf ! [         a     GNRf = f! [         a     GNTf = fs  snnf ! [(         a    [%        SU-  5      ef = f! [          a-    [%        SU< SUR*                  < SUR,                  < S35      ef = f)zE
Factory that creates an app config from an entry in INSTALLED_APPS.
Nr   defaultTr5   r   Fz+ declares more than one default AppConfig: z, zModule 'z' does not contain a 'z' class.z Choices are: %s.z#'%s' isn't a subclass of AppConfig.z"'%s' must supply a name attribute.zCannot import 'z'. Check that 'z.name' is correct.)r   r   APPS_MODULE_NAMEinspect
getmembersisclass
issubclassr8   r9   reprRuntimeErrorjoin	Exceptionr   r   isupperImportErrorr   r   r   AttributeError
__module____qualname__)clsentryapp_config_classr   r   mod_pathmodr   	candidateapp_configs_
candidatescls_namemsgs                 r   createAppConfig.createc   sZ     
/	!&u-J $J0@AA&+-=>#H-
 ,3+=+=c7??+S+S"92 & &0	 &
 $Iy$? &T%+S   {#q('21~a'8$ 0;#/:OD"9i? *)/:   #
 ;'!+@K%LWTd4j
%L*%-tyy/DF  [)Q.+6q>!+<(  '#&   ##0#7 
 "2": %*$4$4S$9!HHQK//11 $H- ,3+=+=c7??+S+S!)1 6?6J DJ+S  
  .:1FFFC!#&& e$ *I66&'Lu'TUU Y+00

	&x0J  55A# &ME  		f   4 " Y*+ORW+WXXY  	& $//$11	 	sw   J )JJ	JJJ J>JJ. J?-J?3J?+K 8K! 
J+*J+.
J<;J<K!7Lc                    U(       a  U R                   R                  5         OU R                   R                  5          U R                  UR	                  5          $ ! [
         a    [        SU R                  < SU< S35      ef = f)zt
Return the model with the given case-insensitive model_name.

Raise LookupError if no model exists with this name.
zApp 'z' doesn't have a 'z' model.)r   check_models_readycheck_apps_readyr	   lowerKeyErrorLookupErrorr   )r   
model_namerequire_readys      r   	get_modelAppConfig.get_model   sl     II((*II&&(	;;z//122 	9=ZP 	s   A )Bc              #     #    U R                   R                  5         U R                  R                  5        HO  nUR                  R
                  (       a	  U(       d  M'  UR                  R                  (       a	  U(       d  MK  Uv   MQ     g7f)aW  
Return an iterable of 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.
Keyword arguments aren't documented; they're a private API.
N)r   r^   r	   values_metaauto_createdswapped)r   include_auto_createdinclude_swappedmodels       r   
get_modelsAppConfig.get_models   sX      			$$&[['')E{{''0D{{""?K *s   B	Bc                     U R                   R                  U R                     U l        [	        U R
                  [        5      (       a(  U R                  < S[        < 3n[        U5      U l	        g g )Nr   )
r   
all_modelsr   r	   r   r   MODELS_MODULE_NAMEr   r   r   )r   models_module_names     r   import_modelsAppConfig.import_models  sT     ii**4::6-?@@,0II7I!J!./A!BD Ar!   c                     g)zD
Override this method in subclasses to run code when Django starts.
N r'   s    r   readyAppConfig.ready  s    r!   )r   r   r	   r   r   r   r   r   N)T)FF)r&   rN   rO   __firstlineno____doc__r   r(   r   r.   propertyr1   r   classmethodr[   re   ro   ru   ry   __static_attributes__rx   r!   r   r   r      sl    H(TB + +
 U U8 z6 z6x"*Cr!   r   )rC   r:   	importlibr   django.core.exceptionsr   django.utils.functionalr   django.utils.module_loadingr   r   rB   rs   r   rx   r!   r   <module>r      s/     	 # 7 3 K  E Er!   