Package s3 :: Module s3anonymize :: Class S3AnonymizeWidget
[frames] | no frames]

Class S3AnonymizeWidget

source code

object --+
         |
        S3AnonymizeWidget

GUI widget for S3Anonymize

Instance Methods

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
widget(cls, r, _class="action-lnk")
Render an action item (link or button) to anonymize the target record of an S3Request, which can be embedded in the record view
source code
Static Methods
 
action_key(widget_id)
Generate a unique STP token for the widget (CSRF protection) and store it in session
source code
 
selector(rules)
Generate the rule selector for anonymize-form
source code
 
buttons()
Generate the submit/cancel buttons for the anonymize-form
source code
 
inject_script(widget_id, options)
Inject the necessary JavaScript for the UI dialog
source code
Properties

Inherited from object: __class__

Method Details

widget(cls, r, _class="action-lnk")
Class Method

source code 

Render an action item (link or button) to anonymize the target record of an S3Request, which can be embedded in the record view

Parameters:
  • r - the S3Request
  • _class - HTML class for the action item
Returns:
the action item (a HTML helper instance), or an empty string if no anonymize-rules are configured for the target table, no target record was specified or the user is not permitted to anonymize it

action_key(widget_id)
Static Method

source code 

Generate a unique STP token for the widget (CSRF protection) and store it in session

Parameters:
  • widget_id - the widget ID (which includes the target table name and record ID)
Returns:
a unique identifier (as string)

selector(rules)
Static Method

source code 

Generate the rule selector for anonymize-form

Parameters:
  • rules - the list of configured rules
Returns:
the selector (DIV)

buttons()
Static Method

source code 

Generate the submit/cancel buttons for the anonymize-form

Returns:
the buttons row (DIV)

inject_script(widget_id, options)
Static Method

source code 

Inject the necessary JavaScript for the UI dialog

Parameters:
  • widget_id - the widget ID
  • options - JSON-serializable dict of widget options