The following configuration Logbook Form is part of the IndustraForms API: sf_form_register.
It has the following fields / columns:
-
logid: The unique identifier for the form register entry. This is passed as a parameter to the j5.IndustraForms.api.create_new_logbook_linked_form function.
-
form_name: The fully-qualified unique identifier of the form specification.
-
form_enabled: Contains ‘Enabled’ if a form register entry is enabled.
-
label: Contains the configured human-readable label.
The sf_form_register recordclass can be accessed by calling Alchemy.find_recordclass(‘sf_form_register’). It can then be used in sqlalchemy queries in order to determine the appropriate sf_form_register.logid to use for a call to j5.IndustraForms.api.create_new_logbook_linked_form.
For example:
def before_session_insert(self, sa_session):
#Find the 'example-form' entry in the sf_form_register table:
sf_form_register = Alchemy.find_recordclass('sf_form_register')
example_form = sa_session.query(sf_form_register).filter(
sf_form_register.form_name == 'example_project.ExampleModule.example-form').first()
#Create a new linked instance of the example-form
create_new_logbook_linked_form(
sa_session=sa_session,
form_register_logid=example_form.logid,
logbook_record=self)
return sqlalchemy.orm.EXT_CONTINUE
Private IndustraForms implementation tables
The following tables must be considered private - their schema and contents may change from time to time:
-
sf_alembic_version
-
sf_specification
-
sf_form_commits
-
sf_attachments
-
sf_form_data
-
sf_form_link
-
sf_form_register