ó
r±E^c           @   s   d  d l  m Z d „  Z d S(   iÿÿÿÿ(   t   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 |  ƒ ‚ n Xd S(   së   
    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.
    t   .i   s`   Invalid model reference '%s'. String model references must be of the form 'app_label.ModelName'.N(   t
   isinstancet   tupleR    t   string_typest   splitt   lowert   _metat	   app_labelt
   model_namet   lent   AssertionErrort
   ValueError(   t   modelt   model_tupleR   R	   (    (    s8   /tmp/pip-unpacked-wheel-4tV8Ix/django/db/models/utils.pyt   make_model_tuple   s    	N(   t   django.utilsR    R   (    (    (    s8   /tmp/pip-unpacked-wheel-4tV8Ix/django/db/models/utils.pyt   <module>   s   