betty.project.url module¶
URL generators for project resources.
- final class betty.project.url.LocalizedUrlGenerator[source]¶
Bases:
LocalizedUrlGenerator
,ProjectDependentFactory
Generate URLs for all resources provided by a Betty project.
- __init__(*upstreams: LocalizedUrlGenerator)[source]¶
This is private. It MUST NOT be used anywhere outside its containing scope.
- generate(resource: Any, media_type: MediaType, *, absolute: bool = False, locale: Localey | None = None) str [source]¶
Generate a localized URL for a localizable resource.
- Raises:
- final class betty.project.url.StaticUrlGenerator[source]¶
Bases:
ProjectDependentFactory
,_ProjectUrlGenerator
,StaticUrlGenerator
Generate URLs for static (non-localized) file paths.
- generate(resource: Any, *, absolute: bool = False) str [source]¶
Generate a static URL for a static resource.
- Raises: