Context processors#

Custom template context processors registered in TEMPLATES["OPTIONS"]["context_processors"] in Settings. They expose a handful of values to every server-rendered template.

meta#

Surfaces application metadata. Currently only last_price_update – the datetime of the most recent share / coin price refresh. Rendered as the tooltip on the application name in the top bar.

richy.core.context_processors.meta(request)[source]#

Adds meta (Meta model) info to the context.

  • last_price_update

settings#

A curated subset of Django settings made available to templates as the settings dict: CHART_COLORS, VERSION, MAX_PRECISION, COINS_MAX_PRECISION. Templates do not have unrestricted access to Django settings – only these.

richy.core.context_processors.settings(request)[source]#

Adds Django settings directives to the context:

  • CHART_COLORS

  • VERSION

  • MAX_PRECISION

  • COINS_MAX_PRECISION

search_form#

Exposes a fresh SearchForm instance under the name search_form so the top-bar / sidebar search renders on every page without each view having to pass it explicitly.

richy.core.context_processors.search_form(request)[source]#

Adds search form (SearchForm) blank instance to the context.

all_symbols#

Exposes the full list of Item symbols under the name all_symbols – consumed by the search-bar autocomplete.

Note

Currently runs an uncached query on every request. The source carries a TODO to cache and invalidate on item add / remove.

richy.core.context_processors.all_symbols(request)[source]#

Adds list of all symbols (all_symbols) to the context.