
    Tim                     n    S SK rSSKJ r  SSKJr  SSKJr  \" / SQ5      r " S S5      r	 " S	 S
\	5      r
g)    N   )typing)current_app)request)getpostheadoptionsdeleteputtracepatchc            	          \ rS rSr% SrSr\R                  \R                  \R                  \
         \S'   Sr\R                  \R                  \      \S'   / r\R                  \R                  \R                         \S'   Sr\R                  \   \S'   S	\R&                  4S
 jr\S\
S\R,                  S\R,                  S	\R.                  4S j5       rSrg)View   a  Subclass this class and override :meth:`dispatch_request` to
create a generic class-based view. Call :meth:`as_view` to create a
view function that creates an instance of the class with the given
arguments and calls its ``dispatch_request`` method with any URL
variables.

See :doc:`views` for a detailed guide.

.. code-block:: python

    class Hello(View):
        init_every_request = False

        def dispatch_request(self, name):
            return f"Hello, {name}!"

    app.add_url_rule(
        "/hello/<name>", view_func=Hello.as_view("hello")
    )

Set :attr:`methods` on the class to change what methods the view
accepts.

Set :attr:`decorators` on the class to apply a list of decorators to
the generated view function. Decorators applied to the class itself
will not be applied to the generated view function!

Set :attr:`init_every_request` to ``False`` for efficiency, unless
you need to store request-global data on ``self``.
Nmethodsprovide_automatic_options
decoratorsTinit_every_requestreturnc                     [        5       e)zThe actual view function behavior. Subclasses must override
this and return a valid response. Any variables from the URL
rule are passed as keyword arguments.
)NotImplementedError)selfs    ]/var/www/html/backend/Backoffice_Marketplace/venv/lib/python3.13/site-packages/flask/views.pydispatch_requestView.dispatch_requestK   s    
 "##    name
class_argsclass_kwargsc                   ^^^^ U R                   (       a+  S[        R                  S[        R                  4UUU4S jjmO0U " T0 TD6mS[        R                  S[        R                  4U4S jjmU R
                  (       a3  UTl        U R                  Tl        U R
                   H  nU" T5      mM     U Tl        UTl        U R                  Tl	        U R                  Tl        U R                  Tl
        U R                  Tl        T$ )a  Convert the class into a view function that can be registered
for a route.

By default, the generated view will create a new instance of the
view class for every request and call its
:meth:`dispatch_request` method. If the view class sets
:attr:`init_every_request` to ``False``, the same instance will
be used for every request.

Except for ``name``, all other arguments passed to this method
are forwarded to the view class ``__init__`` method.

.. versionchanged:: 2.2
    Added the ``init_every_request`` class attribute.
kwargsr   c                  t   > TR                   " T0 TD6n[        R                  " UR                  5      " S0 U D6$ N )
view_classr   ensure_syncr   )r"   r   r   r    views     r   r(   View.as_view.<locals>.viewg   s=    #/ #..t/D/DEOOOr   c                  P   > [         R                  " TR                  5      " S0 U D6$ r$   )r   r'   r   )r"   r   s    r   r(   r)   p   s"    "..t/D/DEOOOr   )r   tAnyftResponseReturnValuer   __name__
__module__r&   __doc__r   r   )clsr   r   r    	decoratorr   r(   s     `` @@r   as_viewView.as_viewR   s    & !!Pquu P)?)? P P 
3l3DPquu P)?)? P >> DM!nnDO ^^	  , {{..{{),)F)F&r   r%   )r/   r0   __qualname____firstlineno__r1   r   r+   ClassVarOptional
Collectionstr__annotations__r   boolr   ListCallabler   r-   r.   r   classmethodr,   RouteCallabler4   __static_attributes__r%   r   r   r   r      s    D :>GQZZ

1<<#456=
 ?Cqzz!**T*:;B 24J

166!**-.3 ,0

4(/$""8"8 $ 11%&UU1<=EE1			1 1r   r   c                      ^  \ rS rSrSrS\R                  SS4U 4S jjrS\R                  S\R                  4S jr
SrU =r$ )	
MethodView   a  Dispatches request methods to the corresponding instance methods.
For example, if you implement a ``get`` method, it will be used to
handle ``GET`` requests.

This can be useful for defining a REST API.

:attr:`methods` is automatically set based on the methods defined on
the class.

See :doc:`views` for a detailed guide.

.. code-block:: python

    class CounterAPI(MethodView):
        def get(self):
            return str(session.get("counter", 0))

        def post(self):
            session["counter"] = session.get("counter", 0) + 1
            return redirect(url_for("counter"))

    app.add_url_rule(
        "/counter", view_func=CounterAPI.as_view("counter")
    )
r"   r   Nc                 x  > [         TU ]  " S0 UD6  SU R                  ;  a  [        5       nU R                   H2  n[        USS 5      (       d  M  UR                  UR                  5        M4     [         H4  n[        X5      (       d  M  UR                  UR                  5       5        M6     U(       a  X l        g g g )Nr   r%   )super__init_subclass____dict__set	__bases__getattrupdater   http_method_funcshasattraddupper)r2   r"   r   basekey	__class__s        r   rH   MethodView.__init_subclass__   s    !+F+CLL(eG4D11NN4<<0 & )3$$KK		, ) %  )r   c                    [        U [        R                  R                  5       S 5      nUc!  [        R                  S:X  a  [        U SS 5      nUc   S[        R                  < 35       e[        R
                  " U5      " S0 UD6$ )NHEADr   zUnimplemented method r%   )rL   r   methodlowerr   r'   )r   r"   meths      r   r   MethodView.dispatch_request   st    tW^^113T: <GNNf44-DK#88J!KK&&t,6v66r   r%   )r/   r0   r6   r7   r1   r+   r,   rH   r-   r.   r   rB   __classcell__)rT   s   @r   rD   rD      sA    4& &4 &"	7 	723I3I 	7 	7r   rD   )r   r+    r-   globalsr   r   	frozensetrN   r   rD   r%   r   r   <module>r`      s:         I 
w wt57 57r   