/usr/local/lib/python3.9/site-packages/django/core/management/commands/__pycache__
a Ӱ�h�* � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm Z d dl mZ d dlm Z mZ zd dlZdZW n ey� dZY n0 zd dlZdZW n ey� dZY n0 G d d � d e�ZG dd� de�ZdS ) � N)�apps)�serializers)�BaseCommand�CommandError)�parse_apps_and_model_labels)�DEFAULT_DB_ALIAS�routerTFc @ s e Zd ZdS )�ProxyModelWarningN)�__name__� __module__�__qualname__� r r �R/usr/local/lib/python3.9/site-packages/django/core/management/commands/dumpdata.pyr s r c @ s e Zd ZdZdd� Zdd� ZdS )�Commandz�Output the contents of the database as a fixture of the given format (using each model's default manager unless --all is specified).c C s� |j ddddd� |j dddd � |j d tdd� |j d tdd � |j dddg dd� |j ddddd� |j ddddd� |j dddddd� |j d d!d"d#� |j d$d%d&d'� d S )(N�argszapp_label[.ModelName]�*zHRestricts dumped data to the specified app_label or app_label.ModelName.)�metavar�nargs�helpz--format�jsonz7Specifies the output serialization format for fixtures.)�defaultr z--indentz>Specifies the indent level to use when pretty-printing output.)�typer z --databasezXNominates a specific database to dump fixtures from. Defaults to the "default" database.z-ez --exclude�appendzhAn app_label or app_label.ModelName to exclude (use multiple --exclude to exclude multiple apps/models).)�actionr r z--natural-foreign� store_true�use_natural_foreign_keysz/Use natural foreign keys if they are available.)r �destr z--natural-primary�use_natural_primary_keysz/Use natural primary keys if they are available.z-az--all�use_base_managerz�Use Django's base manager to dump all models stored in the database, including those that would otherwise be filtered or modified by a custom manager.z--pks�primary_keysz�Only dump objects with given primary keys. Accepts a comma-separated list of keys. This option only works when you specify one model.)r r z-oz--outputz.Specifies file to which the output is written.)r )�add_argument�intr )�self�parserr r r � add_arguments$ sn � ���������zCommand.add_argumentsc s\ |d }|d }|d �|d }|d }|d }|d �|d }|d �|d } | rjdd� | � d �D ��ng �t|�\��|s��r�td��t��fdd�t�� D ��� �n�t|�dkrr�td��i � |D �]\} z�| � d�\}}zt�|�} W n2 t �y } ztt |���W Y d }~n d }~0 0 | jd u �s8| �v �r<W q�z| �|�}W n$ t �yn td||f ��Y n0 � � | g �}|d u�r�||v�r�|�|� W q� t�y& ��r�td��| }zt�|�} W n2 t �y� } ztt |���W Y d }~n d }~0 0 | jd u �s| �v �rY q�d � | <