adl-support.forms-support
Application Description Language support - functions useful in generating forms.
all-keys-present?
macro
(all-keys-present? m keys)
Return true if all the keys in keys
are present in the map m
.
auxlist-data-name
macro
(auxlist-data-name auxlist)
The name to which data for this auxlist
will be bound in the Selmer params.
form-title
(form-title record form-name user-distinct-property-keys)
Construct an appropriate title for a form having this form-name
, for an entity having these user-distinct-property-keys
, given this record
.
get-current-value
macro
(get-current-value f params entity-name)
Use the function f
and these params
to fetch an entity
record from the database.
prepare-insertion-params
macro
(prepare-insertion-params params fields)
Params for insertion into the database must have keys for all fields in the insert query, even if the value of some of those keys is nil. Massage these params
to have a value for each field in these fields
.
property-defaults
(property-defaults entity)
Get a map of property names and default values for all properties of this entity
which have explicit defaults.
query-name
(query-name entity-or-name q-type)
Generate a query name for the query of type q-type
(expected to be one of :create
, :delete
, :get
, :list
, :search-strings
, :update
) of the entity entity-or-name
NOTE: if entity-or-name
is passed as a string, it should be the full, unaltered name of the entity.