Files
wg-backend-django/dell-env/lib/python3.11/site-packages/flask/__pycache__/views.cpython-311.pyc

96 lines
7.5 KiB
Plaintext
Raw Normal View History

2023-10-30 14:40:43 +07:00
<EFBFBD>
~]?em<00><00><><00>ddlZddlmZddlmZddlmZegd<06><01><00>ZGd<07>d<08><00>Z Gd <09>d
e <09><00>Z
dS) <0B>N<>)<01>typing)<01> current_app)<01>request)<08>get<65>post<73>head<61>options<6E>delete<74>put<75>trace<63>patchc <00>b<00>eZdZUdZdZejejeje e
d<dZ ejeje e
d<gZ ejejeje
d<dZeje e
d<dejfd <09>Zed
e d ejd ejdejfd <0A><04><00>ZdS)<0E>ViewaSubclass 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<64>provide_automatic_options<6E>
decoratorsT<EFBFBD>init_every_request<73>returnc<00><00>t<00><00><00>)z<>The actual view function behavior. Subclasses must override
this and return a valid response. Any variables from the URL
rule are passed as keyword arguments.
)<01>NotImplementedError)<01>selfs <20>d/home/infidel/Sync/TIP/WireGuard/ocp-wg-backend/dell-env/lib/python3.11/site-packages/flask/views.py<70>dispatch_requestzView.dispatch_requestKs<00><00>
"<22>#<23>#<23>#<23><00>name<6D>
class_args<EFBFBD> class_kwargsc<00><><00><02><03><05><06>|jr!dtjdtjf<04><02><03>fd<03> <0C>n&|<00>i<00><03><01><01>dtjdtjf<04>fd<04> <0C>|jr(|<01>_|j<00>_|jD] }|<04><06><00><00><06>|<00>_|<01>_|j <00>_ |j<00>_|j
<00>_
|j <00>_ <00>S)afConvert 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.
<20>kwargsrc<00>\<00><03><00>j<00>i<00><03><01>}tj|j<00><00>di|<00><01>S<00>N<>)<04>
view_classr<00> ensure_syncr)r rrr<00>views <20><><EFBFBD>rr&zView.as_view.<locals>.viewgsH<00><><00>&<26>t<EFBFBD><EFBFBD><1F><12>#/<2F><12><12><04>F<01>{<7B>.<2E>t<EFBFBD>/D<>E<>E<>O<>O<><06>O<>O<>Orc<00>B<00><01>tj<00>j<00><00>di|<00><01>Sr")rr%r)r rs <20>rr&zView.as_view.<locals>.viewps'<00><><00>E<>{<7B>.<2E>t<EFBFBD>/D<>E<>E<>O<>O<><06>O<>O<>Or) r<00>t<>Any<6E>ft<66>ResponseReturnValuer<00>__name__<5F>
__module__r$<00>__doc__rr)<07>clsrrr<00> decoratorrr&s `` @@r<00>as_viewz View.as_viewRs%<00><><EFBFBD><EFBFBD><EFBFBD><00>& <0F> !<21> P<01> P<01>q<EFBFBD>u<EFBFBD> P<01><12>)?<3F> P<01> P<01> P<01> P<01> P<01> P<01> P<01> P<01> P<01><17>3<EFBFBD>
<EFBFBD>3<>l<EFBFBD>3<>3<>D<EFBFBD> P<01>q<EFBFBD>u<EFBFBD> P<01><12>)?<3F> P<01> P<01> P<01> P<01> P<01> P<01> <0F>><3E> '<27> <20>D<EFBFBD>M<EFBFBD>!<21>n<EFBFBD>D<EFBFBD>O<EFBFBD> <20>^<5E> '<27> '<27> <09> <20>y<EFBFBD><14><EFBFBD><EFBFBD><04><04><1E><04><0F><1C><04> <0A><1A>{<7B><04> <0C><1D>.<2E><04><0F><1A>{<7B><04> <0C>),<2C>)F<><04>&<26><13> r)r,r-<00> __qualname__r.rr(<00>ClassVar<61>Optional<61>
Collection<EFBFBD>str<74>__annotations__r<00>boolr<00>List<73>Callablerr*r+r<00> classmethodr)<00> RouteCallabler1r#rrrr s <00><00><00><00><00><00><00><08><08>D:><3E>G<EFBFBD>Q<EFBFBD>Z<EFBFBD><01>
<EFBFBD>1<EFBFBD><<3C><03>#4<>5<> 6<>=<3D>=<3D>=<3D>
?C<01><1D>q<EFBFBD>z<EFBFBD>!<21>*<2A>T<EFBFBD>*:<3A>;<3B>B<>B<>B<>24<32>J<EFBFBD><01>
<EFBFBD>1<EFBFBD>6<EFBFBD>!<21>*<2A>-<2D>.<2E>3<>3<>3<>,0<><16><01>
<EFBFBD>4<EFBFBD>(<28>/<2F>/<2F>/<2F>$<24>"<22>"8<>$<24>$<24>$<24>$<24><11>1<14><16>1<14>%&<26>U<EFBFBD>1<14><=<3D>E<EFBFBD>1<14> <0B> <19>1<14>1<14>1<14><11>[<5B>1<14>1<14>1rrc<00>Z<00><00>eZdZdZdejddf<04>fd<05> Zdejdejfd<06>Z <09>xZ
S)<07>
MethodViewa<EFBFBD>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 rNc <00>n<00><01>t<00><00>jdi|<01><01>d|jvr<>t<00><00>}|jD]-}t |dd<00><00>r|<02>|j<00><00><00>.tD]9}t||<04><00>r'|<02>
|<04> <00><00><00><00><00>:|r ||_dSdSdS)Nrr#) <0C>super<65>__init_subclass__<5F>__dict__<5F>set<65> __bases__<5F>getattr<74>updater<00>http_method_funcs<63>hasattr<74>add<64>upper)r/r r<00>base<73>key<65> __class__s <20>rrAzMethodView.__init_subclass__<5F>s<><00><><00>!<21><05><07><07>!<21>+<2B>+<2B>F<EFBFBD>+<2B>+<2B>+<2B> <14>C<EFBFBD>L<EFBFBD> (<28> (<28><19>e<EFBFBD>e<EFBFBD>G<EFBFBD><1B> <0A> 1<> 1<><04><1A>4<EFBFBD><19>D<EFBFBD>1<>1<>1<><1B>N<EFBFBD>N<EFBFBD>4<EFBFBD><<3C>0<>0<>0<><30>(<28> -<2D> -<2D><03><1A>3<EFBFBD><03>$<24>$<24>-<2D><1B>K<EFBFBD>K<EFBFBD><03> <09> <09> <0B> <0B>,<2C>,<2C>,<2C><><16> &<26>%<25><03> <0B> <0B> <0B> )<29> (<28> &<26> &rc <00><00>t|tj<00><00><00>d<00><00>}|<02>!tjdkrt|dd<00><00>}|<02>Jdtj<00><02><02><00><00>t j|<02><00>di|<01><01>S)N<>HEADrzUnimplemented method r#)rEr<00>method<6F>lowerrr%)rr <00>meths rrzMethodView.dispatch_request<73>s<><00><00><16>t<EFBFBD>W<EFBFBD>^<5E>1<>1<>3<>3<>T<EFBFBD>:<3A>:<3A><04> <10><<3C>G<EFBFBD>N<EFBFBD>f<EFBFBD>4<>4<><1A>4<EFBFBD><15><04>-<2D>-<2D>D<EFBFBD><13><1F><1F>!K<><17><1E>!K<>!K<><1F><1F><1F>,<2C>{<7B>&<26>t<EFBFBD>,<2C>,<2C>6<>6<>v<EFBFBD>6<>6<>6r) r,r-r2r.r(r)rAr*r+r<00> __classcell__)rMs@rr>r><00>s~<00><><00><00><00><00><00><08><08>4&<26><11><15>&<26>4<EFBFBD>&<26>&<26>&<26>&<26>&<26>&<26>" 7<><11><15> 7<>2<EFBFBD>3I<33> 7<> 7<> 7<> 7<> 7<> 7<> 7<> 7rr>) rr(<00>r*<00>globalsrr<00> frozensetrGrr>r#rr<00><module>rWs<><00><01><12><12><12><12><1A><1A><1A><1A><1A><1A> <20> <20> <20> <20> <20> <20><1C><1C><1C><1C><1C><1C><1E>I<EFBFBD>I<>I<>I<><02><02><11>
w<14>w<14>w<14>w<14>w<14>w<14>w<14>w<14>t57<>57<>57<>57<>57<><14>57<>57<>57<>57<>57r