https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/views/generic/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/views/generic/__pycache__/detail.cpython-310.pyc
o

ʎ�_k�@s�ddlmZddlmZddlmZddlmZddl	m
Z
mZmZGdd�de
�Z
Gdd	�d	e
e�ZGd
d�de�ZGdd
�d
ee�ZdS)�)�ImproperlyConfigured)�models)�Http404)�gettext)�ContextMixin�TemplateResponseMixin�Viewcs^eZdZdZdZdZdZdZdZdZ	dZ
ddd�Zdd	�Zd
d�Z
dd
�Z�fdd�Z�ZS)�SingleObjectMixinzS
    Provide the ability to retrieve a single object for further manipulation.
    N�slug�pkFcCs�|dur|��}|j�|j�}|j�|j�}|dur |j|d�}|dur9|dus+|jr9|��}|jdi||i��}|durI|durItd|j	j
��z|��}W|S|jjyft
td�d|jjji��w)z�
        Return the object the view is displaying.

        Require `self.queryset` and a `pk` or `slug` argument in the URLconf.
        Subclasses can override this to return any object.
        N)rzXGeneric detail view %s must be called with either an object pk or a slug in the URLconf.z,No %(verbose_name)s found matching the query�verbose_name�)�get_queryset�kwargs�get�pk_url_kwarg�slug_url_kwarg�filter�query_pk_and_slug�get_slug_field�AttributeError�	__class__�__name__�model�DoesNotExistr�_�_metar)�self�querysetrr
�
slug_field�objr
r
�=/usr/lib/python3/dist-packages/django/views/generic/detail.py�
get_objects.	��
���zSingleObjectMixin.get_objectcCs:|jdur|jr|jj��Stdd|jji��|j��S)z�
        Return the `QuerySet` that will be used to look up the object.

        This method is called by the default implementation of get_object() and
        may not be called if get_object() is overridden.
        Nzj%(cls)s is missing a QuerySet. Define %(cls)s.model, %(cls)s.queryset, or override %(cls)s.get_queryset().�cls)rr�_default_manager�allrrr�rr
r
r!r:s
���
zSingleObjectMixin.get_querysetcCs|jS)z;Get the name of a slug field to be used to look up by slug.)rr&r
r
r!rNsz SingleObjectMixin.get_slug_fieldcCs$|jr|jSt|tj�r|jjSdS)z#Get the name to use for the object.N)�context_object_name�
isinstancer�Modelr�
model_name)rr r
r
r!�get_context_object_nameRs
z)SingleObjectMixin.get_context_object_namecsJi}|jr|j|d<|�|j�}|r|j||<|�|�t�jdi|��S)z/Insert the single object into the context dict.�objectNr
)r,r+�update�super�get_context_data)rr�contextr'�rr
r!r/[s


z"SingleObjectMixin.get_context_data)N)r�
__module__�__qualname__�__doc__rrrr'rrrr"rrr+r/�
__classcell__r
r
r1r!r	s
&	r	c@seZdZdZdd�ZdS)�BaseDetailViewz+A base view for displaying a single object.cOs"|��|_|j|jd�}|�|�S)N)r,)r"r,r/�render_to_response)r�request�argsrr0r
r
r!ris

zBaseDetailView.getN)rr2r3r4rr
r
r
r!r6gsr6cs$eZdZdZdZ�fdd�Z�ZS)�!SingleObjectTemplateResponseMixinN�_detailc	s�zt���}W|Styfg}|jr'|jr't|j|jd�}|r'|�d|�t|jtj	�r@|jj
}|�d|j|j
|jf�n t|dd�dur`t|jtj	�r`|�d|jj
j|jj
j
|jf�|sc�Y|Sw)a�
        Return a list of template names to be used for the request. May not be
        called if render_to_response() is overridden. Return the following list:

        * the value of ``template_name`` on the view (if provided)
        * the contents of the ``template_name_field`` field on the
          object instance that the view is operating upon (if available)
        * ``<app_label>/<model_name><template_name_suffix>.html``
        Nrz%s/%s%s.htmlr)r.�get_template_namesrr,�template_name_field�getattr�insertr(rr)r�append�	app_labelr*�template_name_suffix�
issubclassr)r�names�name�object_metar1r
r!r<ss6
#�
����z4SingleObjectTemplateResponseMixin.get_template_names)rr2r3r=rBr<r5r
r
r1r!r:osr:c@seZdZdZdS)�
DetailViewz�
    Render a "detail" view of an object.

    By default this is a model instance looked up from `self.queryset`, but the
    view will support display of *any* object by overriding `self.get_object()`.
    N)rr2r3r4r
r
r
r!rG�srGN)�django.core.exceptionsr�	django.dbr�django.httpr�django.utils.translationrr�django.views.generic.baserrrr	r6r:rGr
r
r
r!�<module>s_5

https://t.me/RX1948 - 2025