File: //lib/python3/dist-packages/django/apps/__pycache__/registry.cpython-310.pyc
o
3�aiD � @ st d dl Z d dlZd dlZd dlZd dlmZmZ d dl mZ d dlm Z m
Z
ddlmZ G dd� d�Z
e
dd �ZdS )
� N)�Counter�defaultdict)�partial)�AppRegistryNotReady�ImproperlyConfigured� )� AppConfigc @ s� e Zd ZdZd/dd�Zd0dd�Zdd � Zd
d� Zdd
� Zdd� Z e
jdd�d1dd��Zd2dd�Z
dd� Zdd� Zdd� Zdd� Ze
jdd�dd � �Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� ZdS )3�Appsz�
A registry that stores the configuration of installed applications.
It also keeps track of models, e.g. to provide reverse relations.
� c C s� |d u rt tjt d�rtd��tt�| _i | _g | _ d | _
| _| _t
�� | _t
�� | _d| _tt�| _|d urA| �|� d S d S )N�appsz+You must supply an installed_apps argument.F)�hasattr�sys�modules�__name__�RuntimeErrorr �dict�
all_models�app_configs�stored_app_configs�
apps_ready�models_ready�ready� threading�Event�ready_event�RLock�_lock�loading�list�_pending_operations�populate)�self�installed_appsr
r
�6/usr/lib/python3/dist-packages/django/apps/registry.py�__init__ s
�z
Apps.__init__Nc C sD | j rdS | j�� | j r W d � dS | jrtd��d| _|D ]%}t|t�r+|}nt�|�}|j| jv r=t d|j ��|| j|j<