File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/django/db/models/__pycache__/utils.cpython-310.pyc
Back
o �h� � @ sL d dl Z d dlmZ dd� Zdd� Zdd� Ze jd d � �ZG dd� d�ZdS ) � N)� namedtuplec C s| z.t | t�r | }nt | t�r| �d�\}}||�� f}n| jj| jjf}t|�dks,J �|W S t t fy= t d| ��w )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'.)� isinstance�tuple�str�split�lower�_meta� app_label� model_name�len� ValueError�AssertionError)�model�model_tupler r � r �L/usr/local/CyberPanel/lib/python3.10/site-packages/django/db/models/utils.py�make_model_tuple s ���r c c s0 � | � � 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&