betty.url.proxy module

Provide proxy URL generators.

final class betty.url.proxy.ProxyLocalizedUrlGenerator[source]

Bases: LocalizedUrlGenerator

Expose multiple other URL generators as one unified URL generator.

__init__(*upstreams: LocalizedUrlGenerator)[source]
static __new__(*args, **kwargs)
generate(resource: Any, media_type: MediaType, *, absolute: bool = False, locale: str | Locale | None = None) str[source]

Generate a URL for a resource.

Raises:
supports(resource: Any) bool[source]

Whether the given resource is supported by this URL generator.

final class betty.url.proxy.ProxyUrlGenerator[source]

Bases: UrlGenerator

Expose multiple other URL generators as one unified URL generator.

__init__(*upstreams: UrlGenerator)[source]
generate(resource: Any, *, media_type: MediaType | None = None, absolute: bool = False, locale: str | Locale | None = None) str[source]

Generate a URL for a resource.

Raises:
supports(resource: Any) bool[source]

Whether the given resource is supported by this URL generator.