
vÅÏ^T  ã               @   s   d  d „  Z  d S)c             C   s¸   y‰ t  |  t ƒ r |  } nQ t  |  t ƒ rT |  j d ƒ \ } } | | j ƒ  f } n |  j j |  j j f } t | ƒ d k s„ t	 ‚ | SWn( t
 t	 f k
 r³ t
 d |  ƒ ‚ Yn Xd 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ÚAssertionErrorÚ
ValueError)ÚmodelZmodel_tupler   r	   © r   ú8/tmp/pip-build-8lau8j11/django/django/db/models/utils.pyÚmake_model_tuple   s    	r   N)r   r   r   r   r   Ú<module>   s    