https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/shortcuts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/shortcuts/__init__.pyc
�
r�\c@s�dZddlZddlmZmZddlmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZdd	lmZd
�Zd�Zd�Zd
�Zd�Zd�Zd�ZdS(s�
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
i����N(tloadertRequestContext(tHttpResponsetHttp404(tHttpResponseRedirecttHttpResponsePermanentRedirect(t	ModelBase(tManager(tQuerySet(turlresolverscOsmi|jdd�d6}|jdd�}|rTtjdtdd�||d<nttj||�|�S(s�
    Returns a HttpResponse whose content is filled with the result of calling
    django.template.loader.render_to_string() with the passed arguments.
    tcontent_typetmimetypesEThe mimetype keyword argument is deprecated, use content_type insteadt
stackleveliN(tpoptNonetwarningstwarntDeprecationWarningRRtrender_to_string(targstkwargsthttpresponse_kwargsR((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pytrender_to_responses	

cOs�i|jdd�d6|jdd�d6}d|krk|jd�}|jdd�r�td��q�n$|jdd�}t|d|�}||d<ttj||�|�S(s�
    Returns a HttpResponse whose content is filled with the result of calling
    django.template.loader.render_to_string() with the passed arguments.
    Uses a RequestContext by default.
    R
tstatustcontext_instancetcurrent_appsVIf you provide a context_instance you must set its current_app before calling render()N(R
Rtgett
ValueErrorRRRR(trequestRRRRR((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pytrenders
cOs7|jdt�rt}nt}|t|||��S(s�
    Returns an HttpResponseRedirect to the appropriate URL for the arguments
    passed.

    The arguments could be:

        * A model: the model's `get_absolute_url()` function will be called.

        * A view name, possibly with arguments: `urlresolvers.reverse()` will
          be used to reverse-resolve the name.

        * A URL, which will be used as-is for the redirect location.

    By default issues a temporary redirect; pass permanent=True to issue a
    permanent redirect
    t	permanent(R
tFalseRRtresolve_url(ttoRRtredirect_class((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pytredirect8s	cCs�t|t�r|St|t�r+|}nOt|t�rF|j}n4t|t�r^|jn	|jj}td|��|j	�S(s�
    Returns a QuerySet from a Model, Manager, or QuerySet. Created to make
    get_object_or_404 and get_list_or_404 more DRY.

    Raises a ValueError if klass is not a Model, Manager, or QuerySet.
    sHObject is of type '%s', but must be a Django Model, Manager, or QuerySet(
t
isinstanceRRRt_default_managerttypet__name__t	__class__Rtall(tklasstmanagertklass__name((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pyt
_get_querysetPs	
cOsWt|�}y|j||�SWn0|jjk
rRtd|jjj��nXdS(s_
    Uses get() to return an object, or raises a Http404 exception if the object
    does not exist.

    klass may be a Model, Manager, or QuerySet object. All other passed
    arguments and keyword arguments are used in the get() query.

    Note: Like with get(), an MultipleObjectsReturned will be raised if more than one
    object is found.
    sNo %s matches the given query.N(R-RtmodeltDoesNotExistRt_metatobject_name(R*RRtqueryset((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pytget_object_or_404ds
cOsJt|�}t|j||��}|sFtd|jjj��n|S(s�
    Uses filter() to return a list of objects, or raise a Http404 exception if
    the list is empty.

    klass may be a Model, Manager, or QuerySet object. All other passed
    arguments and keyword arguments are used in the filter() query.
    sNo %s matches the given query.(R-tlisttfilterRR.R0R1(R*RRR2tobj_list((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pytget_list_or_404us
cOs�t|d�r|j�Sytj|d|d|�SWnDtjk
r|t|�r[�nd|kr}d|kr}�q}nX|S(sV
    Return a URL appropriate for the arguments passed.

    The arguments could be:

        * A model: the model's `get_absolute_url()` function will be called.

        * A view name, possibly with arguments: `urlresolvers.reverse()` will
          be used to reverse-resolve the name.

        * A URL, which will be returned as-is.

    tget_absolute_urlRRt/t.(thasattrR8R	treversetNoReverseMatchtcallable(R!RR((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pyR �s

(t__doc__Rtdjango.templateRRtdjango.httpRRRRtdjango.db.models.baseRtdjango.db.models.managerRtdjango.db.models.queryRtdjango.coreR	RRR#R-R3R7R (((s;/tmp/pip-install-XxeQeY/django/django/shortcuts/__init__.pyt<module>s						

https://t.me/AnonymousX5 - 2025