Helper Functions
charts_allow_anon_building_charts()
Check if anonymous users are allowed to build charts.
RETURNS | DESCRIPTION |
---|---|
bool
|
True if anonymous users are allowed to build charts, False otherwise.
TYPE:
|
Source code in ckanext/charts/helpers.py
84 85 86 87 88 89 90 |
|
charts_get_resource_columns(resource_id)
Get the columns of the given resource.
PARAMETER | DESCRIPTION |
---|---|
resource_id |
Resource ID
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
JSON string of columns options
TYPE:
|
Source code in ckanext/charts/helpers.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
charts_include_htmx_asset()
Checks if the HTMX asset should be included.
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the HTMX asset should be included, False otherwise.
TYPE:
|
Source code in ckanext/charts/helpers.py
41 42 43 44 45 46 47 |
|
charts_reinit_ckan_js_modules()
Checks if CKAN JS modules should be reinitialized.
RETURNS | DESCRIPTION |
---|---|
bool
|
True if CKAN JS modules should be reinitialized, False otherwise.
TYPE:
|
Source code in ckanext/charts/helpers.py
50 51 52 53 54 55 56 |
|
charts_user_is_authenticated()
Check if the user is authenticated.
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the user is authenticated, False otherwise.
TYPE:
|
Source code in ckanext/charts/helpers.py
75 76 77 78 79 80 81 |
|
get_available_chart_engines_options()
Get the available chart engines.
RETURNS | DESCRIPTION |
---|---|
list[dict[str, str]]
|
List of chart engines options |
Source code in ckanext/charts/helpers.py
32 33 34 35 36 37 38 |
|
get_file_cache_size()
Get the size of the file cache in a human-readable format.
RETURNS | DESCRIPTION |
---|---|
str
|
Human-readable file cache size
TYPE:
|
Source code in ckanext/charts/helpers.py
23 24 25 26 27 28 29 |
|
get_redis_cache_size()
Get the size of the Redis cache in a human-readable format.
RETURNS | DESCRIPTION |
---|---|
str
|
Human-readable Redis cache size
TYPE:
|
Source code in ckanext/charts/helpers.py
14 15 16 17 18 19 20 |
|