ผลต่างระหว่างรุ่นของ "Multi-component Page"

จาก คูนิฟ็อกซ์ วิกิ
ไม่มีความย่อการแก้ไข
ไม่มีความย่อการแก้ไข
บรรทัดที่ 2: บรรทัดที่ 2:


In the CuneiFox framework, inter-related forms and tables can be linked together via the use of ''Document Context''. Below are the key functions of Document Context:
In the CuneiFox framework, inter-related forms and tables can be linked together via the use of ''Document Context''. Below are the key functions of Document Context:
* xxx
 
*xxx
* Control page-level '''permissions and operations'''.
*xxx
* Perform a '''document-lock/unlock''' upon entering entering/exiting the page's edit mode.
* '''Consolidate populating request''' for all forms and tables on the page.
* String together '''page edit sequence'''.


== Define a Document Context ==
== Define a Document Context ==
Document Context is a dict fed to the Flask {{code|render_template}} function. Most of the keys in the dict are handled (with default values assigned, if not given) by a separate Python function {{code|prep_mainseq}}. We shall begin with these so-called ''Main Sequence'' keys, then we will discuss a few additional keys. [[#More render_template Arguments]]
=== Main Sequence Keys ===
=== Additional Document Context Keys ===
=== More {{code|render_template}} Arguments ===
Finally, in the last sub-section of this part, we will list a few commonly used {{code|render_template}} arguments that are not parts of Document Context, but are useful nonetheless.


== Fit the Context on an HTML Page ==
== Fit the Context on an HTML Page ==

รุ่นแก้ไขเมื่อ 09:38, 27 มิถุนายน 2567

While CuneiForms and CuneiTables on each of their own can create functional pages for several purposes, most accounting and transaction records require both to be displayed and manipulated in a meaningful manner. And while it is possible for such pages to be perfectly functional by stringing stad-alone forms and tables together, the numbers of requests and database accesses are unnecessarily high.

In the CuneiFox framework, inter-related forms and tables can be linked together via the use of Document Context. Below are the key functions of Document Context:

  • Control page-level permissions and operations.
  • Perform a document-lock/unlock upon entering entering/exiting the page's edit mode.
  • Consolidate populating request for all forms and tables on the page.
  • String together page edit sequence.

Define a Document Context

Document Context is a dict fed to the Flask render_template function. Most of the keys in the dict are handled (with default values assigned, if not given) by a separate Python function prep_mainseq. We shall begin with these so-called Main Sequence keys, then we will discuss a few additional keys. #More render_template Arguments

Main Sequence Keys

Additional Document Context Keys

More render_template Arguments

Finally, in the last sub-section of this part, we will list a few commonly used render_template arguments that are not parts of Document Context, but are useful nonetheless.

Fit the Context on an HTML Page

Page-level Permission & Document Locking

Useful Patterns