a
    Šxd=  ã                   @   s   d d„ Z dd„ ZdS )c              	   C   s„   z\t | tƒr| }n6t | tƒr8|  d¡\}}|| ¡ f}n| jj| jjf}t|ƒdksXJ ‚|W S  t	t
fy~   t	d|  ƒ‚Y n0 dS )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ÚlowerZ_metaÚ	app_labelÚ
model_nameÚlenÚ
ValueErrorÚAssertionError)ÚmodelZmodel_tupler   r	   © r   úN/var/www/html/Ranjet/env/lib/python3.9/site-packages/django/db/models/utils.pyÚmake_model_tuple   s    

ÿÿr   c                 c   s.   |   ¡ D ] \}}|t|ƒr |ƒ n|fV  qdS )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   N)r   r   r   r   r   r   Ú<module>   s   