
    h;$                        S SK r S SKJrJr  S SKJr  S SKJrJrJ	r	J
r
Jr  S SKJr  S SKJr  S SKJr  S SKJr  \ R(                  " S	5      r " S
 S5      r " S S5      r " S S5      r " S S\\\5      r " S S\5      rg)    N)iscoroutinefunctionmarkcoroutinefunction)ImproperlyConfigured)HttpResponseHttpResponseGoneHttpResponseNotAllowedHttpResponsePermanentRedirectHttpResponseRedirect)TemplateResponse)reverse)classonlymethod)classpropertyzdjango.requestc                   "    \ rS rSrSrSrS rSrg)ContextMixin   zs
A default context mixin that passes the keyword arguments received by
get_context_data() as the template context.
Nc                 z    UR                  SU 5        U R                  b  UR                  U R                  5        U$ )Nview)
setdefaultextra_contextupdate)selfkwargss     K/var/www/html/env/lib/python3.13/site-packages/django/views/generic/base.pyget_context_dataContextMixin.get_context_data   s5    &$')MM$,,-     )__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r   r   r   r   r      s    
 Mr   r   c                   d    \ rS rSrSr/ SQrS r\S 5       r\	S 5       r
S rS rS	 rS
 rS rSrg)View$   zq
Intentionally simple parent class for all views. Only implements
dispatch-by-method and simple sanity checking.
)getpostputpatchdeleteheadoptionstracec                 N    UR                  5        H  u  p#[        XU5        M     g)zd
Constructor. Called in the URLconf; can contain helpful extra
keyword arguments, and other things.
N)itemssetattr)r   r   keyvalues       r   __init__View.__init__5   s      !,,.JCDu% )r   c                 &  ^ U R                    Vs/ s H(  nUS:w  d  M  [        X5      (       d  M  [        X5      PM*     nnU(       d  g[        US   5      m[	        U4S jUSS   5       5      (       d  [        U R                   S35      eT$ s  snf )Nr-   Fr   c              3   @   >#    U  H  n[        U5      T:H  v   M     g 7fN)r   ).0his_asyncs     r   	<genexpr>%View.view_is_async.<locals>.<genexpr>I   s     L|!&q)X5|s      z4 HTTP handlers must either be all sync or all async.)http_method_nameshasattrgetattrr   allr   r    )clsmethodhandlersr;   s      @r   view_is_asyncView.view_is_async?   s     //
/)# !(/(< !GC / 	 

 &x{3Lx|LLL&##$ %   
s   
BBBc                   ^ ^ T H_  nUT R                   ;   a  [        SU< ST R                  < S35      e[        T U5      (       a  MD  [        T R                  < SU< S35      e   U U4S jnT Ul        TUl        T R                  Ul        T R                  Ul        T R                  R                  Ul	        UR                  R                  T R                  R                  5        T R                  (       a  [        U5        U$ )z0Main entry point for a request-response process.zThe method name z* is not accepted as a keyword argument to z().z() received an invalid keyword zJ. as_view only accepts arguments that are already attributes of the class.c                    > T" S0 TD6nUR                   " U /UQ70 UD6  [        US5      (       d  [        STR                  -  5      eUR                  " U /UQ70 UD6$ )Nrequestz\%s instance has no 'request' attribute. Did you override setup() and forget to call super()?r   )setupr@   AttributeErrorr   dispatch)rJ   argsr   r   rC   
initkwargss       r   r   View.as_view.<locals>.view`   sm    $$DJJw0004++$:<?LLI  ==:4:6::r   )r?   	TypeErrorr   r@   
view_classview_initkwargsr"   r   rM   __annotations____dict__r   rF   r   )rC   rO   r2   r   s   ``  r   as_viewView.as_viewP   s     Cc+++"%s||5  3$$ 36,,E  	; )
 {{.."||;; 	S\\223 !$'r   c                     [        U S5      (       a"  [        U S5      (       d  U R                  U l        Xl        X l        X0l        g)z1Initialize attributes shared by all view methods.r'   r,   N)r@   r'   r,   rJ   rN   r   r   rJ   rN   r   s       r   rK   
View.setup}   s5    4f(=(=DI	r   c                     UR                   R                  5       U R                  ;   a/  [        XR                   R                  5       U R                  5      nOU R                  nU" U/UQ70 UD6$ r8   )rD   lowerr?   rA   http_method_not_allowed)r   rJ   rN   r   handlers        r   rM   View.dispatch   sc     >>!T%;%;;nn**,d.J.JG 22Gw0000r   c                    ^ [         R                  SUR                  UR                  SUS.S9  [	        U R                  5       5      mU R                  (       a  U4S jnU" 5       $ T$ )NzMethod Not Allowed (%s): %si  status_coderJ   extrac                     >#    T $ 7fr8   r   responses   r   func*View.http_method_not_allowed.<locals>.func           )loggerwarningrD   pathr   _allowed_methodsrF   r   rJ   rN   r   rh   rg   s        @r   r]   View.http_method_not_allowed   s^    )NNLL"%':	 	 	
 *$*?*?*AB  6MOr   c                    ^ [        5       mSR                  U R                  5       5      TR                  S'   STR                  S'   U R                  (       a  U4S jnU" 5       $ T$ )z8Handle responding to requests for the OPTIONS HTTP verb.z, Allow0zContent-Lengthc                     >#    T $ 7fr8   r   rf   s   r   rh   View.options.<locals>.func   rj   rk   )r   joinro   headersrF   rp   s        @r   r-   View.options   sY    >$(IId.C.C.E$F!-0)*  6MOr   c                     U R                    Vs/ s H%  n[        X5      (       d  M  UR                  5       PM'     sn$ s  snf r8   )r?   r@   upper)r   ms     r   ro   View._allowed_methods   s1    #'#9#9N#9aWT=M		#9NNNs   >>)rN   r,   r   rJ   N)r   r   r    r!   r"   r?   r4   r   rF   r   rV   rK   rM   r]   r-   ro   r#   r   r   r   r%   r%   $   sW    
	&    * *X
1$Or   r%   c                   4    \ rS rSrSrSrSr\rSr	S r
S rSrg)TemplateResponseMixin   z.A mixin that can be used to render a template.Nc                     UR                  SU R                  5        U R                  " SU R                  U R	                  5       UU R
                  S.UD6$ )z
Return a response, using the `response_class` for this view, with a
template rendered with the given context.

Pass response_kwargs to the constructor of the response class.
content_type)rJ   templatecontextusingr   )r   r   response_classrJ   get_template_namestemplate_engine)r   r   response_kwargss      r   render_to_response(TemplateResponseMixin.render_to_response   s[     	"">43D3DE"" 
LL,,.&&	

 
 	
r   c                 L    U R                   c  [        S5      eU R                   /$ )z
Return a list of template names to be used for the request. Must return
a list. May not be called if render_to_response() is overridden.
ztTemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()')template_namer   )r   s    r   r   (TemplateResponseMixin.get_template_names   s4    
 %&Q 
 &&''r   r   )r   r   r    r!   r"   r   r   r   r   r   r   r   r#   r   r   r   r   r      s#    8MO%NL
 (r   r   c                       \ rS rSrSrS rSrg)TemplateView   zL
Render a template. Pass keyword arguments from the URLconf to the context.
c                 H    U R                   " S0 UD6nU R                  U5      $ )Nr   )r   r   )r   rJ   rN   r   r   s        r   r'   TemplateView.get   s&    ''1&1&&w//r   r   N)r   r   r    r!   r"   r'   r#   r   r   r   r   r      s    0r   r   c                   X    \ rS rSrSrSrSrSrSrS r	S r
S rS rS	 rS
 rS rS rSrg)RedirectView   z&Provide a redirect on any GET request.FNc                 $   U R                   (       a  U R                   U-  nO'U R                  (       a  [        U R                  XS9nOgU R                  R                  R                  SS5      nU(       a  U R                  (       a	  U< SU< 3nU$ )z
Return the URL redirect to. Keyword arguments from the URL pattern
match generating the redirect request are provided as kwargs to this
method.
)rN   r   NQUERY_STRING ?)urlpattern_namer   rJ   METAr'   query_string)r   rN   r   r   s       r   get_redirect_urlRedirectView.get_redirect_url   sm     88((V#C$++$FC||  $$^R8D%% $'C
r   c                     U R                   " U0 UD6nU(       a'  U R                  (       a  [        U5      $ [        U5      $ [        R                  SUR                  SUS.S9  [        5       $ )NzGone: %si  ra   rc   )r   	permanentr	   r
   rl   rm   rn   r   )r   rJ   rN   r   r   s        r   r'   RedirectView.get   sd    ##T4V4~~4S99+C00NNGLLPW0X   $%%r   c                 .    U R                   " U/UQ70 UD6$ r8   r'   rY   s       r   r,   RedirectView.head      xx1$1&11r   c                 .    U R                   " U/UQ70 UD6$ r8   r   rY   s       r   r(   RedirectView.post  r   r   c                 .    U R                   " U/UQ70 UD6$ r8   r   rY   s       r   r-   RedirectView.options  r   r   c                 .    U R                   " U/UQ70 UD6$ r8   r   rY   s       r   r+   RedirectView.delete  r   r   c                 .    U R                   " U/UQ70 UD6$ r8   r   rY   s       r   r)   RedirectView.put  r   r   c                 .    U R                   " U/UQ70 UD6$ r8   r   rY   s       r   r*   RedirectView.patch  r   r   r   )r   r   r    r!   r"   r   r   r   r   r   r'   r,   r(   r-   r+   r)   r*   r#   r   r   r   r   r      sA    0I
CLL$&222222r   r   )loggingasgiref.syncr   r   django.core.exceptionsr   django.httpr   r   r   r	   r
   django.template.responser   django.urlsr   django.utils.decoratorsr   django.utils.functionalr   	getLoggerrl   r   r%   r   r   r   r   r   r   <module>r      sx     C 7  6  3 1			+	, OO OOd#( #(L0(, 0724 72r   