Skip to main content

Crate forms

Crate forms 

Source
Expand description

Client-side form model: descriptors, raw values, syntax checks and the submit payload writer. Pure: no database, no wasm, no nomiscript.

Modules§

address
Field addresses: a flat field is its key, row i of a rows field is key.i and a cell of that row is key.i.sub. The index is any display, so a template row can carry a placeholder.
filter
Report filter grammar: the operator names the server parser reads and the writer the visual builder emits them with.
labels
The typed text of a select control. A browser shows an entity by its label in a control named label:<address> and submits its id in a hidden input named by the address; the text is only echoed back, never resolved.

Structs§

Field
FieldError
Form
FormValues
Raw text values: flat fields by key, rows fields as lists of rows.

Enums§

Action
Kind
The seven field kinds; another needs owner sign-off.
Scope
The kind of entity whose tags a text cell suggests.
Source
Suggest
Free-text suggestions a text cell offers, served by form-options as plain strings rather than picker options.

Constants§

ACCOUNT_CREATE
Create an account under an optional parent.
ACCOUNT_EDIT
Rename, re-parent and replace the tags of an account; tags excludes the name tag and is edited, not carried.
ACCOUNT_MERGE
Fold from into into: its splits, lots, budgets, children and tags move and from is deleted.
COMMODITY_CREATE
Create a commodity from a symbol and a name.
COMMODITY_EDIT
Replace the symbol, the name and the tags of a commodity; tags excludes both and is edited, not carried.
CONFIG_SET
Set one of the user’s config values; an empty value is stored as is.
CONVERT
Convert an amount between two commodities with the latest price.
LINK_CELL
The cell of a nested row naming the key of its parent row.
PAGING_KEYS
Keys of transaction-query that page a result instead of filtering it.
PARENT_KEY_CELL
The cell of a parent row holding the key its nested rows name.
REPORT_ACTIVITY
REPORT_BALANCE
REPORT_CATEGORY
include-uncategorized is the command’s include_uncategorized, yes by default.
SCRIPT_CREATE
Create a script from an optional name, its source and its state.
SCRIPT_EDIT
Replace the name, the source and the state of a script; the revision covers all three.
SPLITS_KEY
Keys of the rows fields that split tags nest under.
SPLIT_TAGS_KEY
SSH_KEY_ADD
Register a public key with an optional label; without one the key line’s comment names it.
TAGS_KEY
TAG_CREATE
Create a tag from a name, a value and an optional description.
TAG_EDIT
Replace the name, the value and the description of a tag; the revision covers all three.
TEMPLATE_CREATE
Create a template from an optional name and its source.
TEMPLATE_EDIT
Replace the name and the source of a template; the revision covers both.
TEMPLATE_TEST
Render a template source against the user’s data without saving it.
TRANSACTION_CREATE
TRANSACTION_EDIT
TRANSACTION_QUERY

Functions§

all
by_name
descriptor_sexpr
descriptors_sexpr
drop_orphans
Drops the rows of every nested field of form whose link cell names a parent row that values no longer holds; a missing field stays missing.
escape_str
Quote a string for a nomiscript literal.
now_instant
The current instant as a full RFC3339 UTC value, the seed of an empty date.
parse_date
parse_date_in for UTC.
parse_date_in
Parse RFC3339 (full precision), YYYY-MM-DD, YYYY-MM-DDTHH:MM[:SS] or YYYY-MM-DD HH:MM (offset-free forms are UTC). A date-only value is the start of that day in zone, or, when range_end is set, the last microsecond (the finest instant Postgres stores) before the next local day starts.
parse_day
A calendar day YYYY-MM-DD; a value with a time is refused, never truncated.
parse_post_date
parse_date for a transaction post date: a date-only value is noon UTC, so it stays on that day for every zone from UTC-12 to UTC+11.
step_date
Add delta_days to the date in s. An RFC3339 value keeps its offset, seconds and fractions; YYYY-MM-DDTHH:MM:SS keeps its seconds; a date-only value stays date-only; other forms step to YYYY-MM-DDTHH:MM. None leaves the caller’s buffer untouched (unparseable input or overflow).
write_payload
Write the payload in descriptor order. Absent values are omitted; a present empty value is written, so an edit can clear the note.

Type Aliases§

Row