a
    còf«  ã                   @   s<   d Z ddlmZ ddlmZ ddlmZ dd„ Zdd„ Z	d	S )
zZ
utils.py        # Shared helper functions

See schemas.__init__.py for package overview.
é    )Úmodels)Úgettext_lazy)ÚRetrieveModelMixinc                 C   sZ   t |dƒr|jdkS | ¡ dkr$dS t|tƒr2dS |  d¡ d¡}|rVd|d v rVdS dS )	zP
    Return True if the given path/method appears to represent a list view.
    ÚactionÚlistÚgetFú/Ú{éÿÿÿÿT)Úhasattrr   ÚlowerÚ
isinstancer   ÚstripÚsplit)ÚpathÚmethodÚviewZpath_components© r   úY/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/rest_framework/schemas/utils.pyÚis_list_view   s    


r   c                 C   sJ   t |tjƒrtdƒ}nt |tjƒr,tdƒ}ntdƒ}tdƒj|| jjd�S )Nzunique integer valuezUUID stringzunique valuez'A {value_type} identifying this {name}.)Ú
value_typeÚname)r   r   Z	AutoFieldÚ_Z	UUIDFieldÚformatÚ_metaZverbose_name)ÚmodelZmodel_fieldr   r   r   r   Úget_pk_description   s    

þr   N)
Ú__doc__Z	django.dbr   Zdjango.utils.translationr   r   Zrest_framework.mixinsr   r   r   r   r   r   r   Ú<module>   s
   