tcms.core.views module

class tcms.core.views.DashboardView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

dispatch(request, *args, **kwargs)
get_context_data(**kwargs)[source]

List all recent TestPlans and TestRuns

template_name = 'dashboard.html'
class tcms.core.views.NavigationView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

template_name = 'navigation.html'
class tcms.core.views.TranslationMode(**kwargs)[source]

Bases: django.views.generic.base.View

Turns on and off translation mode by switching language to Esperanto!

get(request)[source]

In the HTML template we’d like to work with simple links however the view which actually switches the language needs to be called via POST so we simulate that here!

If the URL doesn’t explicitly specify language then we turn-off translation mode by switching back to browser preferred language.

static get_browser_language(request)[source]

Returns ONLY the language that is sent by the browser via the Accept-Language headers. Defaults to settings.LANGUAGE_CODE if that doesn’t work!

This is the language we switch back to when translation mode is turned off.

Copied from the bottom half of django.utils.translation.trans_real.get_language_from_request()

Note

Using get_language_from_request() doesn’t work for us because it first inspects session and cookies and we’ve already set Esperanto in both the session and the cookie!

tcms.core.views.server_error(request)[source]

Render the error page with request object which supports static URLs so we can load a nice picture.