î
ªÍ Xˆ  ã               @   s    d  d l  m Z d d „  Z d S)é    )Úsixc             C   s»   yŒ t  |  t ƒ r |  } nT t  |  t j ƒ rW |  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ë
    Takes a model or a string of the form "app_label.ModelName" and returns a
    corresponding ("app_label", "modelname") tuple. If a tuple is passed in,
    it's assumed to be a valid model tuple already and returned unchanged.
    Ú.é   z`Invalid model reference '%s'. String model references must be of the form 'app_label.ModelName'.N)Ú
isinstanceÚtupler   Ústring_typesÚsplitÚlowerZ_metaÚ	app_labelÚ
model_nameÚlenÚAssertionErrorÚ
ValueError)ÚmodelZmodel_tupler
   r   © r   úD/home/ubuntu/projects/ifolica/build/django/django/db/models/utils.pyÚmake_model_tuple   s    	r   N)Zdjango.utilsr   r   r   r   r   r   Ú<module>   s   