ALDashboard.aldashboard
- ALDashboard.aldashboard
- speedy_get_users
- speedy_get_sessions
- dashboard_get_session_variables
- ALPackageInstaller
- ErrorList
- ErrorLikeObject
- install_fonts
- list_installed_fonts
- nicer_interview_filename
- make_usage_rows
- dashboard_session_activity
- compute_heatmap_styles
- list_question_files_in_package
- list_question_files_in_docassemble_packages
- increment_index_value
- get_current_index_value
- get_latest_s3_folder
speedy_get_users
def speedy_get_users() -> List[Dict[int, str]]
Return a list of all users in the database. Possibly faster than get_user_list().
speedy_get_sessions
def speedy_get_sessions(user_id: Optional[int] = None,
filename: Optional[str] = None,
filter_step1: bool = True,
metadata_key_name: str = "metadata") -> List[Tuple]
Return a list of the most recent 500 sessions, optionally tied to a specific user ID.
Each session is a tuple with named columns: filename, user_id, modtime, key
dashboard_get_session_variables
def dashboard_get_session_variables(session_id: str, filename: str)
Return the variables and steps for a given session ID and YAML filename in serializable dictionary format.
ALPackageInstaller Objects
class ALPackageInstaller(DAObject)
Methods and state for installing AssemblyLine.
get_validated_github_username
def get_validated_github_username(access_token: str)
Given a valid GitHub access_token, returns the username associated with it.
Otherwise, adds one or more errors to the installer.
ErrorList Objects
class ErrorList(DAList)
Contains ErrorLikeObjects so they can be recognized by docassemble.
ErrorLikeObject Objects
class ErrorLikeObject(DAObject)
An object with a template_name that identifies the DALazyTemplate that will
show its error. It can contain any other attributes so its template can access them
as needed. DAObject doesn't seem to be enough to allow template definition.
install_fonts
def install_fonts(the_font_files: DAFileList)
Install fonts to the server and restart both supervisor and unoconv.
list_installed_fonts
def list_installed_fonts()
List the fonts installed on the server.
nicer_interview_filename
def nicer_interview_filename(filename: str) -> str
Given a filename like docassemble.playground10ALWeaver:data/questions/assembly_line.yml, return a less cluttered name like: playground10ALWeaver:assembly_line
make_usage_rows
def make_usage_rows(current_interview_usage: Optional[Dict[int, List[Dict]]],
nicer_fn: Callable[[str], str] = lambda x: x,
limit: int = 10) -> List[Dict]
Convert the nested current_interview_usage structure into a list of rows
suitable for rendering in the template.
Arguments
current_interview_usage- mapping of minute -> list of dicts with keys including 'filename', 'sessions', 'users'. Typically the output ofdashboard_session_activity.nicer_fn- callable that receives a filename and returns a display title.limit- maximum number of rows to return (sorted by total recent sessions).
Returns
A list of dicts with keys: filename, title, s_1, s_5, s_10, s_30, s_60, s_120, users, total
dashboard_session_activity
def dashboard_session_activity(minutes_list=None,
limit: int = 10,
exclude_filenames=None)
Return a dict mapping each minutes value to a list of top interviews by session starts during the last N minutes. Each list contains dicts with keys: filename, sessions, users, title.
Arguments
-
minutes_list- time windows to report on (default: [1, 5, 10, 30, 60, 120]) -
limit- max interviews per window (default: 10) -
exclude_filenames- list of exact filenames or package prefixes to exclude. By default, excludes docassemble.ALDashboard: and entries from get_config("assembly line",{}).get("interview list",{}).get("exclude from interview list")Example return value:
-
{60- [{'filename': 'docassemble.foo:data/questions/x.yml', 'sessions': 12, 'users': 9, 'title': 'foo:x'}, ...], ...}
compute_heatmap_styles
def compute_heatmap_styles(rows, windows: Optional[tuple] = None)
Add inline styles for a log-scaled heatmap to each row dict.
list_question_files_in_package
def list_question_files_in_package(package_name: str) -> Optional[List[str]]
List all the files in the 'data/questions' directory of a package.
Arguments
package_namestr - The name of the package to list files from.
Returns
List[str]- A list of filenames in the 'data/questions' directory of the package.
list_question_files_in_docassemble_packages
def list_question_files_in_docassemble_packages()
List all the files in the 'data/questions' directory of all docassemble packages.
Returns
Dict[str, List[str]]: A dictionary where the keys are package names and the values are lists of filenames in the 'data/questions' directory of the package.
increment_index_value
def increment_index_value(by: int = 5000,
index_name: str = "uploads_indexno_seq")
Increment the file index value in the database by a specified amount.
Arguments
byint - The amount to increment the file index value by. Defaults to 5000.index_namestr - The name of the sequence to increment. Defaults to "uploads_indexno_seq".
get_current_index_value
def get_current_index_value() -> int
Get the current value of the file index sequence.
Returns
int- The current value of the file index sequence.
get_latest_s3_folder
def get_latest_s3_folder(prefix: str = "files/") -> Optional[int]
Return the highest integer “folder” that exists directly under prefix, or None if there are no numeric folders at all.
• Uses the S3 LIST paginator, so it works for any number of prefixes. • Ignores non‑numeric folder names (e.g. files/tmp/, files/images/, …). • Requires only read permission for ListObjectsV2.
Example return value: 45237