tcms.core.views module¶
- class tcms.core.views.DashboardView(**kwargs)[source]¶
Bases:
TemplateView
- dispatch(request, *args, **kwargs)¶
- template_name = 'dashboard.html'¶
- class tcms.core.views.InitDBView(**kwargs)[source]¶
Bases:
TemplateView
- template_name = 'initdb.html'¶
- class tcms.core.views.IterOpen(args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), *, user=None, group=None, extra_groups=None, encoding=None, errors=None, text=None, umask=-1, pipesize=-1, process_group=None)[source]¶
Bases:
Popen
Popen which allows us to iterate over the output so we can stream it back to the browser with some extra eye candy!
- has_completed = False¶
- still_waiting = True¶
- property timestamp¶
- class tcms.core.views.TranslationMode(**kwargs)[source]¶
Bases:
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!