AppInterface.set_attach_rules
AppInterface.set_attach_rules |
Purpose
Sets the 'rules' used to validate attachments and attachment meta-data.
Synopsis
set_attach_rules(self, new_rules: xpressinsight.AttachmentRules)
Argument
new_rules
|
Populated
insightattachmentrules record
|
Example
Demonstration of setting the example rules
>>> insight.set_attach_rules(AttachmentRules( ... max_size=1*1024*1024, ... max_attach_count=25, ... max_filename_len=32, ... invalid_filename_chars=['/', r'', ' '], ... max_description_len=128, ... ))
Further information
1. Used to change the rules that are applied to new attachments - for example, if you want to test how your code responds to the
AttachStatus.TOO_MANY error code without actually creating a lot of attachments, you can use this procedure to set a lower number of attachments per scenario.
2. Setting this property when
insight.test_mode is
False will cause the model to abort with a runtime error.