There are various useful functions in kay.utils.
Get the timezone.
| Parameter: | tzname – The name of a timezone. |
|---|---|
| Returns: | datetime.tzinfo implementation |
Get the URL to an endpoint. There are some special keyword arguments:
_anchor: This string is used as URL anchor.
_external: If set to True the URL will be generated with the full server name and http:// prefix.
| Parameter: | args – Keyword arguments are used for building a URL |
|---|---|
| Returns: | string representing the URL to an endpoint |
Get the URL for a login page.
| Parameter: | url – The URL which user is redirected after the login process. If none supplied, the current URL will be use. |
|---|---|
| Returns: | string representing the login URL. |
Get the URL for a logout page.
| Parameter: | url – The URL which user is redirected after the logout process. If none supplied, the current URL will be use. |
|---|---|
| Returns: | string representing the logout URL. |
Render an instance of werkzeug.exceptions.HTTPException with Jinja2 template.
| Parameter: | e – An instance of any subclass of werkzeug.exceptions.HTTPException |
|---|---|
| Returns: | An instance of werkzeug.Response |
A function for template rendering adding useful variables to context automatically, according to the CONTEXT_PROCESSORS settings.
| Parameters: |
|
|---|---|
| Returns: | Rendered string |
A function for render html pages.
| Parameters: |
|
|---|---|
| Returns: | Rendered response |
Convert a datetime object to the local timezone.
| Parameters: |
|
|---|---|
| Returns: | datetime.datetime object with new timezone |
Convert a datetime object to UTC and drop tzinfo.
| Parameters: |
|
|---|---|
| Returns: | datetime.datetime object with UTC timezone |
Try to get the data with given key_name and return it or raise werkzeug.exceptions.NotFound when failed.
| Parameters: |
|
|---|---|
| Returns: | an instance of the model class on success |
Try to get the data with given id and return it or raise werkzeug.exceptions.NotFound when failed.
| Parameters: |
|
|---|---|
| Returns: | an instance of the model class on success |
Try to get the data with given key and return it or raise werkzeug.exceptions.NotFound when failed.
| Parameters: |
|
|---|---|
| Returns: | an instance of the model class on success |