betty.url package¶
Submodules¶
Module contents¶
Provide a URL generation API.
- exception betty.url.GenerationError[source]¶
Bases:
RuntimeErrorA URL generation error.
- exception betty.url.InvalidMediaType[source]¶
Bases:
GenerationErrorRaised when a URL generator cannot generate a URL for a resource with the given media type.
- class betty.url.LocalizedUrlGenerator[source]¶
Bases:
_UrlGeneratorGenerate URLs for localizable resources.
- static __new__(*args, **kwargs)¶
- class betty.url.PassthroughUrlGenerator[source]¶
Bases:
UrlGeneratorReturns resources verbatim if they are absolute URLs already.
- class betty.url.StaticUrlGenerator[source]¶
Bases:
_UrlGeneratorGenerate URLs for static (non-localizable) resources.
- static __new__(*args, **kwargs)¶
- exception betty.url.UnsupportedResource[source]¶
Bases:
GenerationErrorRaised when a URL generator cannot generate a URL for a resource.
These are preventable by checking
betty.url.LocalizedUrlGenerator.supports()orbetty.url.StaticUrlGenerator.supports()first.