Package s3 :: Module s3forms :: Class S3SQLDefaultForm
[frames] | no frames]

Class S3SQLDefaultForm

source code

object --+    
         |    
 S3SQLForm --+
             |
            S3SQLDefaultForm

Standard SQL form

Instance Methods
 
__call__(self, request=None, resource=None, record_id=None, readonly=False, message="Record created/updated", format=None, **options)
Render/process the form.
source code
 
prepopulate(self, from_table=None, from_record=None, map_fields=None, data=None, format=None)
Pre-populate the form with values from a previous record or controller-submitted data
source code
 
deduplicate_link(self, request, record_id)
Change to update if this request attempts to create a duplicate entry in a link table
source code
 
process(self, form, vars, onvalidation=None, onaccept=None, hierarchy=None, link=None, http="POST", format=None)
Process the form
source code

Inherited from S3SQLForm: __init__, __len__

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

Properties

Inherited from object: __class__

Method Details

__call__(self, request=None, resource=None, record_id=None, readonly=False, message="Record created/updated", format=None, **options)
(Call operator)

source code 

Render/process the form.

Parameters:
  • request - the S3Request
  • resource - the target S3Resource
  • record_id - the record ID
  • readonly - render the form read-only
  • message - message upon successful form submission
  • format - data format extension (for audit)
  • options - keyword options for the form
Returns:
a FORM instance
Overrides: S3SQLForm.__call__

To Do: describe keyword arguments

prepopulate(self, from_table=None, from_record=None, map_fields=None, data=None, format=None)

source code 

Pre-populate the form with values from a previous record or controller-submitted data

Parameters:
  • from_table - the table to copy the data from
  • from_record - the record to copy the data from
  • map_fields - field selection/mapping
  • data - the data to prepopulate the form with
  • format - the request format extension

deduplicate_link(self, request, record_id)

source code 

Change to update if this request attempts to create a duplicate entry in a link table

Parameters:
  • request - the request
  • record_id - the record ID

process(self, form, vars, onvalidation=None, onaccept=None, hierarchy=None, link=None, http="POST", format=None)

source code 

Process the form

Parameters:
  • form - FORM instance
  • vars - request POST variables
  • onvalidation - callback(function) upon successful form validation
  • onaccept - callback(function) upon successful form acceptance
  • hierarchy - the data for the hierarchy link to create
  • link - component link
  • http - HTTP method
  • format - request extension