1,844
การแก้ไข
| บรรทัดที่ 165: | บรรทัดที่ 165: | ||
=== Notes on Keyword Arguments === | === Notes on Keyword Arguments === | ||
The following sub-sections introduce notable keyword arguments. Other keywords not detailed here are also welcome during CuneiForm initiation. Unless explicitly specified, all keyword arguments can be accessed post-initiation as attributes of the created CuneiForm instance. | |||
==== MASTER-adjacents ==== | ==== MASTER-adjacents ==== | ||
Back to the [[#Define]] section, we are introduced to a number of {{code|MASTER_xxx}} variables. Those variables set at form definition act as the default values for each form type. However, developers can feed an overriding value that applies only to the form being initiated using a corresponding non-master keyword (e.g. use keyword {{code|instacalc}} to override the class's {{code|MASTER_instacalc}}). | Back to the [[#Define]] section, we are introduced to a number of {{code|MASTER_xxx}} variables. Those variables set at form definition act as the default values for each form type. However, developers can feed an overriding value that applies only to the form being initiated using a corresponding non-master keyword (e.g. use keyword {{code|instacalc}} to override the class's {{code|MASTER_instacalc}}). | ||
| บรรทัดที่ 173: | บรรทัดที่ 175: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
form.instacalc = {str trigger_fld0: [ | |||
url_for_string route0, | |||
[str collect_fld00, str collect_fld01, ...], | |||
[str result_fld00, str result_fld01, ...]]), | |||
... | |||
]), | |||
str trigger_fld1: [ | |||
url_for_string route1, | |||
[str collect_fld10, str collect_fld11, ...], | |||
[str result_fld10, str result_fld11, ...]]), | |||
... | |||
]), | |||
...] | |||
# Example from Product Return / Cancelled Order header form | # Example from Product Return / Cancelled Order header form | ||
| บรรทัดที่ 202: | บรรทัดที่ 204: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
tax_form.taxdate.special_type = "date" | |||
tax_form.taxmonth.special_type = "month" | |||
tax_form.rate.special_type = "pct" | |||
tax_form.amt.special_type = "acc" | |||
tax_form.tax.special_type = "acc" | |||
tax_form.rate_2.special_type = "pct" | |||
tax_form.amt_2.special_type = "acc" | |||
tax_form.tax_2.special_type = "acc" | |||
# For file types, values are thus packed: | # For file types, values are thus packed: | ||
product_form.pict.special_type = "img" | |||
product_form.pict.file_src_type = "table" | |||
product_form.pict.file_src_dir = "product" | |||
</syntaxhighlight> | </syntaxhighlight> | ||