Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/laces/__pycache__/components.cpython-310.pyc

60 lines
3.8 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>f<EFBFBD><00>@s<>ddlmZmZddlmZmZddlmZddlm Z ddl
m Z er6ddlm Z ddl mZddl
mZGd d
<EFBFBD>d
ed <0B>ZGd d <0A>d ee <00>ZdS)<0F>)<02> TYPE_CHECKING<4E>List)<02>Media<69>MediaDefiningClass)<01>Context)<01> get_template)<01>HasMediaProperty)<01>Optional)<01>
SafeString)<01> RenderContextc@sZeZdZUdZeed< d   ddd <09>Z 
 dd d <0C>Zer+e de
fd d<0E><04>Z dSdS)<12> Componenta
A class that knows how to render itself.
Extracted from Wagtail. See:
https://github.com/wagtail/wagtail/blob/094834909d5c4b48517fd2703eb1f6d386572ffa/wagtail/admin/ui/components.py#L8-L22 # noqa: E501
A component uses the `MetaDefiningClass` metaclass to add a `media` property, which
allows the definitions of CSS and JavaScript assets that are associated with the
component. This works the same as `Media` class used by Django forms.
See also: https://docs.djangoproject.com/en/4.2/topics/forms/media/
<20> template_nameN<65>parent_context<78>Optional[RenderContext]<5D>returnr
cCs<|durt<00>}|<00>|<01>}|durtd<02><01>t|j<04>}|<03>|<02>S)a<>
Return string representation of the object.
Given a context dictionary from the calling template (which may be a
`django.template.Context` object or a plain `dict` of context variables),
returns the string representation to be rendered.
This will be subject to Django's HTML escaping rules, so a return value
consisting of HTML should typically be returned as a
`django.utils.safestring.SafeString` instance.
Nz/Expected a dict from get_context_data, got None)r<00>get_context_data<74> TypeErrorrr <00>render)<04>selfr<00> context_data<74>template<74>r<00>R/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/laces/components.py<70> render_html!s


zComponent.render_htmlr cCsiS<00>Nr)rrrrrr9szComponent.get_context_datacCsdSrr)rrrr<00>mediaGszComponent.mediar)rrrr
)rr rr) <0C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>str<74>__annotations__rrr<00>propertyrrrrrrr s$
 <02><02>
<EFBFBD><02>
<EFBFBD><04>r )<01> metaclassc@s"eZdZdZedefdd<04><04>ZdS)<06>MediaContainera<72>
A list that provides a `media` property that combines the media definitions
of its members.
Extracted from Wagtail. See:
https://github.com/wagtail/wagtail/blob/ca8a87077b82e20397e5a5b80154d923995e6ca9/wagtail/admin/ui/components.py#L25-L36 # noqa: E501
The `MediaContainer` functionality depends on the `django.forms.widgets.Media`
class. The `Media` class provides the logic to combine the media definitions of
multiple objects through its `__add__` method. The `MediaContainer` relies on this
functionality to provide a `media` property that combines the media definitions of
its members.
See also:
https://docs.djangoproject.com/en/4.2/topics/forms/media
rcCst<00>}|D]}||j7}q|S)z<>
Return a `Media` object containing the media definitions of all members.
This makes use of the `Media.__add__` method, which combines the media
definitions of two `Media` objects.
)rr)rr<00>itemrrrr^s  zMediaContainer.mediaN)rrrrr"rrrrrrr$Lsr$N)<12>typingrr<00>django.forms.widgetsrr<00>django.templater<00>django.template.loaderr<00> laces.typingrr <00>django.utils.safestringr
r r r$rrrr<00><module>s      :