OwlCyberSecurity - MANAGER
Edit File: utils.cpython-39.pyc
a ���e� � @ sL d dl Z d dlmZ dd� Zdd� Zdd� Ze jd d � �ZG dd� d�ZdS ) � N)� namedtuplec C s� z\t | t�r| }n6t | t�r8| �d�\}}||�� f}n| jj| jjf}t|�dksXJ �|W S t t fy~ t d| ��Y n0 dS )z� Take a model or a string of the form "app_label.ModelName" and return a corresponding ("app_label", "modelname") tuple. If a tuple is passed in, assume it's a valid model tuple already and return it unchanged. �.� z`Invalid model reference '%s'. String model references must be of the form 'app_label.ModelName'.N)� isinstance�tuple�str�split�lower�_meta� app_label� model_name�len� ValueError�AssertionError)�modelZmodel_tupler r � r �W/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/db/models/utils.py�make_model_tuple s ��r c c s. | � � D ] \}}|t|�r |� n|fV qdS )zp Generate key/value pairs for the given mapping where the values are evaluated if they're callable. N)�items�callable)�mapping�k�vr r r �resolve_callables s r c C s t | � |� S �N)�create_namedtuple_class)�names�valuesr r r �unpickle_named_row% s r c s&