| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/django/views/generic/__pycache__/ |
Upload File : |
�
�|�ek � � � d dl mZ d dlmZ d dlmZ d dlmZ d dl m
Z
mZmZ G d� de
� � Z
G d� d e
e� � Z G d
� de� � Z G d� d
ee� � ZdS )� )�ImproperlyConfigured)�models)�Http404)�gettext)�ContextMixin�TemplateResponseMixin�Viewc �X � � e Zd ZdZdZdZdZdZdZdZ dZ
dd�Zd� Zd� Z
d � Z� fd
�Z� xZS )�SingleObjectMixinzS
Provide the ability to retrieve a single object for further manipulation.
N�slug�pkFc �, � |�| � � � }| j � | j � � }| j � | j � � }|�|� |�� � }|�,|�| j r#| � � � } |j di ||i��}|�|�t d| j j
z � � � |� � � }nC# |j j $ r1 t t d� � d|j j j iz � � �w xY w|S )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)r
zXGeneric 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�querysetr
r �
slug_field�objs �=/usr/lib/python3/dist-packages/django/views/generic/detail.py�
get_objectzSingleObjectMixin.get_object sG � � ���(�(�*�*�H� �[�_�_�T�.�
/�
/���{���t�2�3�3��
�>����"��-�-�H� ����t�/E���,�,�.�.�J�&�x��<�<�*�d�);�<�<�H� �:�$�,� �/�15��1H�I�� �
�
O��,�,�.�.�C�C���~�*� O� O� O��!�J�K�K�)�8�>�+?�+L�M�N� O� O�
O� O���� �
s
�<C �A Dc �� � | j �C| j r| j j � � � S t dd| j j iz � � �| 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)r! r �_default_manager�allr r r �r s r$ r zSingleObjectMixin.get_queryset: sp � � �=� ��z�
��z�2�6�6�8�8�8�*�.� �t�~�6�1��� � � �}� � �"�"�"� c � � | j S )z;Get the name of a slug field to be used to look up by slug.)r"