getter module

class StandardDataHandler

Bases: FetcherMeta

get_comment(refnr)

Retrieves the reception comment associated with a form reference number.

Parameters:

refnr (str) – Reference number.

Return type:

str | None

Returns:

The comment string, or None.

get_contact_info(refnr)

Retrieves full contact person details for a submission reference number.

Parameters:

refnr (str) – Reference number.

Return type:

ContactInfo

Returns:

A ContactInfo model populated with retrieved values.

get_dynamic_list(settings, wildcard, refnr)

Queries dynamic list entries matching a wildcard field pattern.

Parameters:
  • settings (EditorSettings) – Active editor configuration settings.

  • wildcard (str) – Slashed path search pattern (e.g. /sub_units/*).

  • refnr (str) – Reference number.

Return type:

list[dict]

Returns:

A list of dictionary records representing row values.

get_field(setting, container, inputs)

Retrieves the value of a specific field from the database.

Parameters:
  • settings – Active editor configuration settings.

  • container (FieldCallbackContainer) – The callback metadata wrapper containing the field settings.

  • inputs (list) – State and inputs wired into the field trigger callbacks.

  • setting (EditorSettings)

Returns:

The field value retrieved from the database.

get_form_status(refnr)

Retrieves active and status state of the specified form.

Parameters:

refnr (str) – Reference number of the submission.

Return type:

RefnrStatus | None

Returns:

A RefnrStatus instance or None if not found.

get_history(refnr, insert_toogle)

Retrieves editing history log for a specific unit submission.

Parameters:
  • refnr (str) – Reference number.

  • insert_toggle – Optional boolean switch to filter out initial insert rows.

  • insert_toogle (bool)

Return type:

DataFrame

Returns:

A pandas DataFrame with history details.

get_info_row_fields(settings, refnr, period, fields, states)

Queries and returns metadata values for the InfoRow fields.

Parameters:
  • settings (EditorSettings) – Editor settings context.

  • refnr (str) – Reference number.

  • period (str) – Statistical period.

  • fields (list[InfoRowField]) – List of metadata fields to query.

  • states (dict[str, dict]) – Map of active VariableSelector state items.

Return type:

dict[str, str | int | bool | float | None]

Returns:

A dictionary mapping field names to their database values.

get_refnrs_by_period_ident(settings, ident, period)

Retrieves all submission reference numbers for a given respondent and period.

Parameters:
  • settings (EditorSettings) – Editor settings context.

  • ident (str) – Respondent identifier.

  • period (str) – Statistical period.

Return type:

list[RefnrStatusExtended]

Returns:

A list containing submission records or None.

get_timeseries(settings, variable, refnr, ident, periods)

Retrieves historical values of target variables over multiple periods.

Parameters:
  • settings (EditorSettings) – Active editor configuration settings.

  • variable (str | list[str]) – Target field name path(s).

  • refnr (str) – Reference number.

  • ident (str) – Respondent identifier.

  • periods (list[str]) – List of previous statistical periods to fetch.

Returns:

A list of dictionary records mapping periods to values.

update_field_value(refnr, skjema, ident, period, value, old_value, settings, container, inputs, editing_code)

Updates the database value of a specific field.

Parameters:
  • refnr (str) – Reference number.

  • skjema (str | None) – Questionnaire schema name.

  • ident (str) – Respondent identifier.

  • period (str) – Statistical period.

  • value (Any) – The new updated value.

  • old_value (Any) – The previous field value.

  • settings (EditorSettings) – Active editor configuration settings.

  • container (FieldCallbackContainer) – The callback metadata wrapper containing the field settings.

  • inputs (list[Any] | dict[Any, Any]) – Wired input states.

  • editing_code (str | None) – Selected editing reason code.

Return type:

None

Returns:

The result of the database write operation.

update_form_active_status(refnr, value)

Updates the active flag of a form submission.

Parameters:
  • refnr (str) – Reference number.

  • value (bool) – True if active, False otherwise.

Return type:

None

update_form_reception_comment(refnr, comment)

Updates or saves a comment associated with a form reference number.

Parameters:
  • refnr (str) – Reference number.

  • comment (str) – The comment text.

Return type:

None

update_form_status(refnr, status_code, on_skjemadata_update=False)

Updates the processing status of a form.

Parameters:
  • refnr (str) – Reference number.

  • status_code (Literal['Under behandling', 'Ferdig', 'Ubehandlet']) – New status value.

  • on_skjemadata_update (bool)

Return type:

None