Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/django/__pycache__/shortcuts.cpython-312.pyc

86 lines
7.6 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
g<> ij<00><00><><00>dZddlmZmZmZmZddlmZddlm Z m
Z
ddl m Z  dd<07>Z ddd <09>d
<EFBFBD>Zd <0B>Zd <0C>Zd <0A>Zd<0E>Zd<0F>Zd<10>Zy)z<>
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.
<EFBFBD>)<04>Http404<30> HttpResponse<73>HttpResponsePermanentRedirect<63>HttpResponseRedirect)<01>loader)<02>NoReverseMatch<63>reverse)<01>PromiseNc<00>N<00>tj||||<05><01>}t|||<04>S)z<>
Return an HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
)<01>using)r<00>render_to_stringr)<07>request<73> template_name<6D>context<78> content_type<70>statusr <00>contents <20>?E:\Project\pygoedge\.venv\Lib\site-packages\django/shortcuts.py<70>renderrs)<00><00><15>%<25>%<25>m<EFBFBD>W<EFBFBD>g<EFBFBD>U<EFBFBD>S<>G<EFBFBD> <17><07><1C>v<EFBFBD> 6<>6<>F)<02> permanent<6E>preserve_requestc<00>L<00>|rtnt}|t|g|<03><01>i|<04><01>|<02><01>S)ak
Return 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: `urls.reverse()` will be used
to reverse-resolve the name.
* A URL, which will be used as-is for the redirect location.
Issues a temporary redirect by default. Set permanent=True to issue a
permanent redirect. Set preserve_request=True to instruct the user agent
to preserve the original HTTP method and body when following the redirect.
)r)rr<00> resolve_url)<06>torr<00>args<67>kwargs<67>redirect_classs r<00>redirectrs6<00><00>&*3<>%<25>8L<38><13> <1A><13>B<EFBFBD>(<28><14>(<28><16>(<28>)<29> <06>rc<00>R<00>t|d<01>r|jj<00>S|S)z<>
Return a QuerySet or a Manager.
Duck typing in action: any class with a `get()` method (for
get_object_or_404) or a `filter()` method (for get_list_or_404) might do
the job.
<20>_default_manager)<03>hasattrr!<00>all)<01>klasss r<00> _get_querysetr%8s)<00><00><0F>u<EFBFBD>(<28>)<29><14>%<25>%<25>)<29>)<29>+<2B>+<2B> <10>Lrc<00>h<00>t|<00>}t|d<01>s@t|t<00>r |jn|j
j}t d|z<00><00> |j|i|<02><01>S#|jj$r-td|jjjz<00><00>wxYw)aY
Use get() to return an object, or raise an 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.
Like with QuerySet.get(), MultipleObjectsReturned is raised if more than
one object is found.
<20>getzVFirst argument to get_object_or_404() must be a Model, Manager, or QuerySet, not '%s'.<2E>No %s matches the given query.) r%r"<00>
isinstance<EFBFBD>type<70>__name__<5F> __class__<5F>
ValueErrorr'<00>model<65> DoesNotExistr<00>_meta<74> object_name<6D>r$rr<00>queryset<65> klass__names r<00>get_object_or_404r5Es<><00><00><1D>U<EFBFBD>#<23>H<EFBFBD> <12>8<EFBFBD>U<EFBFBD> #<23>(<28><15><04>5<>E<EFBFBD>N<EFBFBD>N<EFBFBD>5<EFBFBD>?<3F>?<3F>;S<>;S<> <14><19> %<25>'2<> 3<>
<EFBFBD>
<EFBFBD>
<EFBFBD><1B>x<EFBFBD>|<7C>|<7C>T<EFBFBD>,<2C>V<EFBFBD>,<2C>,<2C><> <13>><3E>><3E> &<26> &<26>
<EFBFBD><15> ,<2C>x<EFBFBD>~<7E>~<7E>/C<>/C<>/O<>/O<> O<>
<EFBFBD>
<EFBFBD>
<EFBFBD>s <00>A+<00>+AB1c<00><00><>K<00>t|<00>}t|d<01>sAt|t<00>r |jn|j
j}t d|<04>d<03><03><00> |j|i|<02><01><01>d{<00><03><03>S7<00>#|jj$r.td|jjj<00>d<06><03><00>wxYw<01>w)zSee get_object_or_404().<2E>agetzSFirst argument to aget_object_or_404() must be a Model, Manager, or QuerySet, not '<27>'.N<>No <20> matches the given query.) r%r"r)r*r+r,r-r7r.r/rr0r1r2s r<00>aget_object_or_404r;as<><00><00><><00><1C>U<EFBFBD>#<23>H<EFBFBD> <12>8<EFBFBD>V<EFBFBD> $<24>(<28><15><04>5<>E<EFBFBD>N<EFBFBD>N<EFBFBD>5<EFBFBD>?<3F>?<3F>;S<>;S<> <14><19> <1E>)<29>]<5D>"<22> .<2E>
<EFBFBD>
<EFBFBD>Y<01>"<22>X<EFBFBD>]<5D>]<5D>D<EFBFBD>3<>F<EFBFBD>3<>3<>3<>3<><33> <13>><3E>><3E> &<26> &<26>Y<01><15><03>H<EFBFBD>N<EFBFBD>N<EFBFBD>0<>0<><<3C><<3C>=<3D>=V<>W<>X<>X<>Y<01>s1<00>AC<01>A8<00>1A6<04>2A8<00>5C<01>6A8<00>8AB?<03>?Cc<00>F<00>t|<00>}t|d<01>s@t|t<00>r |jn|j
j}t d|z<00><00>t|j|i|<02><01><01>}|s,td|jjjz<00><00>|S)z<>
Use filter() to return a list of objects, or raise an 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.
<20>filterzTFirst argument to get_list_or_404() must be a Model, Manager, or QuerySet, not '%s'.r() r%r"r)r*r+r,r-<00>listr=rr.r0r1)r$rrr3r4<00>obj_lists r<00>get_list_or_404r@rs<><00><00><1D>U<EFBFBD>#<23>H<EFBFBD> <12>8<EFBFBD>X<EFBFBD> &<26>(<28><15><04>5<>E<EFBFBD>N<EFBFBD>N<EFBFBD>5<EFBFBD>?<3F>?<3F>;S<>;S<> <14><19> "<22>$/<2F> 0<>
<EFBFBD>
<EFBFBD><14>O<EFBFBD>H<EFBFBD>O<EFBFBD>O<EFBFBD>T<EFBFBD>4<>V<EFBFBD>4<>5<>H<EFBFBD> <13><15> ,<2C>x<EFBFBD>~<7E>~<7E>/C<>/C<>/O<>/O<> O<>
<EFBFBD>
<EFBFBD> <14>Orc<00><00>vK<00>t|<00>}t|d<01>sAt|t<00>r |jn|j
j}t d|<04>d<03><03><00>|j|i|<02><01>2<00>cgc3d{<00><04><03>}|<05><02> 7<00>6ncc}w}}|s-td|jjj<00>d<06><03><00>|S<00>w)zSee get_list_or_404().r=zQFirst argument to aget_list_or_404() must be a Model, Manager, or QuerySet, not 'r8Nr9r:) r%r"r)r*r+r,r-r=rr.r0r1)r$rrr3r4<00>objr?s r<00>aget_list_or_404rC<00>s<><00><00><><00><1C>U<EFBFBD>#<23>H<EFBFBD> <12>8<EFBFBD>X<EFBFBD> &<26>(<28><15><04>5<>E<EFBFBD>N<EFBFBD>N<EFBFBD>5<EFBFBD>?<3F>?<3F>;S<>;S<> <14><19> <1E>)<29>]<5D>"<22> .<2E>
<EFBFBD>
<EFBFBD>&5<>X<EFBFBD>_<EFBFBD>_<EFBFBD>d<EFBFBD>%E<>f<EFBFBD>%E<>F<>F<>c<EFBFBD><03>F<><46>F<><46>F<>H<EFBFBD>F<> <13><15><03>H<EFBFBD>N<EFBFBD>N<EFBFBD>0<>0<><<3C><<3C>=<3D>=V<>W<>X<>X<> <13>O<EFBFBD>s6<00>A-B9<01>/B<04>1A?<06>5A=
<EFBFBD>6A?<06>9B<04>=A?<06>?B<04>9B9c<00><00>t|d<01>r|j<00>St|t<00>r t |<00>}t|t<00>r|j d<02>r|S t |||<02><03>S#t$rt|<00>r<01>d|vrd|vr<01>Y|SwxYw)aM
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: `urls.reverse()` will be used
to reverse-resolve the name.
* A URL, which will be returned as-is.
<20>get_absolute_url)z./z../)rr<00>/<2F>.) r"rEr)r
<00>str<74>
startswithr r<00>callable)rrrs rrr<00>s<><00><00><0F>r<EFBFBD>%<25>&<26><11>"<22>"<22>$<24>$<24><11>"<22>g<EFBFBD><1E><11><12>W<EFBFBD><02><12>"<22>c<EFBFBD><1A>r<EFBFBD>}<7D>}<7D>]<5D>;<3B><11> <09><12><16>r<EFBFBD><04>V<EFBFBD>4<>4<><34> <19><12> <13>B<EFBFBD><<3C> <11> <0E>b<EFBFBD>=<3D>S<EFBFBD><02>]<5D> <11><> <0E>I<EFBFBD><12>s<00> A*<00>*B <03> B )NNNN)<15>__doc__<5F> django.httprrrr<00>django.templater<00> django.urlsrr <00>django.utils.functionalr
rrr%r5r;r@rCr<00>rr<00><module>rQsV<00><01><04> <02><02> #<23>/<2F>+<2B>QU<01>7<>#(<28>%<25><06>6
<11>
<EFBFBD>8Y<01>"<14>2<14>"&r