Package s3 :: Module s3merge :: Class S3Merge
[frames] | no frames]

Class S3Merge

source code

     object --+    
              |    
s3rest.S3Method --+
                  |
                 S3Merge

Interactive Record Merger

Instance Methods
 
apply_method(self, r, **attr)
Apply Merge methods
source code
 
mark(self, r, **attr)
Bookmark the current record for de-duplication
source code
 
unmark(self, r, **attr)
Remove a record from the deduplicate list
source code
 
duplicates(self, r, **attr)
Renders a list of all currently duplicate-bookmarked records in this resource, with option to select two and initiate the merge process from here
source code
 
merge(self, r, **attr)
Merge form for two records
source code

Inherited from s3rest.S3Method: __call__

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

Class Methods
 
bookmark(cls, r, tablename, record_id)
Get a bookmark link for a record in order to embed it in the view, also renders a link to the duplicate bookmark list to initiate the merge process from
source code
 
onvalidation(cls, tablename, form)
Runs the onvalidation routine for this table, and maps form fields and errors to regular keys
source code
Static Methods
 
init_requires(field, o, d)
Initialize all IS_NOT_IN_DB to allow override of both original and duplicate value
source code
 
widget(field, value, download_url=None, **attr)
Render a widget for the Field/value
source code

Inherited from s3rest.S3Method: crud_string

Class Variables
  DEDUPLICATE = "deduplicate"
  ORIGINAL = "original"
  DUPLICATE = "duplicate"
  KEEP = Storage(o= "keep_original", d= "keep_duplicate")
Properties

Inherited from object: __class__

Method Details

apply_method(self, r, **attr)

source code 

Apply Merge methods

Parameters:
  • r - the S3Request
  • attr - dictionary of parameters for the method handler
Returns:
output object to send to the view
Overrides: s3rest.S3Method.apply_method

mark(self, r, **attr)

source code 

Bookmark the current record for de-duplication

Parameters:
  • r - the S3Request
  • attr - the controller parameters for the request

unmark(self, r, **attr)

source code 

Remove a record from the deduplicate list

Parameters:
  • r - the S3Request
  • attr - the controller parameters for the request

bookmark(cls, r, tablename, record_id)
Class Method

source code 

Get a bookmark link for a record in order to embed it in the view, also renders a link to the duplicate bookmark list to initiate the merge process from

Parameters:
  • r - the S3Request
  • tablename - the table name
  • record_id - the record ID

duplicates(self, r, **attr)

source code 

Renders a list of all currently duplicate-bookmarked records in this resource, with option to select two and initiate the merge process from here

Parameters:
  • r - the S3Request
  • attr - the controller attributes for the request

merge(self, r, **attr)

source code 

Merge form for two records

Parameters:
  • r - the S3Request
  • **attr - the controller attributes for the request

Note: this method can always only be POSTed, and requires both "selected" and "mode" in post_vars, as well as the duplicate bookmarks list in session.s3

onvalidation(cls, tablename, form)
Class Method

source code 

Runs the onvalidation routine for this table, and maps form fields and errors to regular keys

Parameters:
  • tablename - the table name
  • form - the FORM

init_requires(field, o, d)
Static Method

source code 

Initialize all IS_NOT_IN_DB to allow override of both original and duplicate value

Parameters:
  • field - the Field
  • o - the original value
  • d - the duplicate value

widget(field, value, download_url=None, **attr)
Static Method

source code 

Render a widget for the Field/value

Parameters:
  • field - the Field
  • value - the value
  • download_url - the download URL for upload fields
  • attr - the HTML attributes for the widget
Returns:
output
Overrides: s3rest.S3Method.widget
Notes:
  • upload fields currently not rendered because the upload widget wouldn't render the current value, hence pointless for merge
  • custom widgets must allow override of both _id and _name attributes

Class Variable Details

DEDUPLICATE

Value:
"deduplicate"

ORIGINAL

Value:
"original"

DUPLICATE

Value:
"duplicate"

KEEP

Value:
Storage(o= "keep_original", d= "keep_duplicate")