wiki:S3/TableConfigurationSettings

Version 37 (modified by MattS, 10 years ago) ( diff )

--

Table Configuration Settings

  • TO BE COMPLETED

CRUD

General

These options affect all interactive CRUD functions:

Option Short Description Value See Also
insertablewhether new records can be inserted into the tableboolean
editablewhether records in the table can be editedboolean
deletablewhether records in the table can be deletedboolean

Forms

These options are relevant for CRUD forms:

Option Short Description Value See Also
subheadingsSubheadings to insert into CRUD formsstructure
mark_requiredEnforce fields to be marked as required in formslist of field names
onvalidationHook to validate recordsfunction
create_onvalidationHook to validate new records (overrides onvalidation for create)function
update_onvalidationHook to validate record updates (overrides onvalidation for update)function
onacceptHook to perform post-commit actionsfunction
create_onacceptHook to perform post-commit actions for new records (overrides onaccept for create)function
update_onacceptHook to perform post-commit actions for record updates (overrides onaccept for update)function
create_nexttarget for redirection after successful createURL
update_nexttarget for redirection after successful updateURL
post_processpost-process hook for old EmbeddedComponentWidget (no longer used)function

Data Tables / Data Lists

Option Short Description Value See Also
list_fieldsfields to show in data tables / listslist of field names
linktoURL to link the ID column in data tables to (usually overridden by s3.actions)URL
linkto_updateURL to link the ID column in data tables to (overrides linkto if the user is permitted to update)URL
extra_fieldsfields to be loaded regardless whether they are in list_fields or not (e.g. because they are needed for virtual fields)list of field names
listaddwhether to provide an embedded create-form in data table viewsboolean
addbtnwhether to show a button for adding a record to the tableboolean
list_layoutcard renderer for data listsfunction or class
orderbydefault orderby for data tables/listsexpression
list_orderbydefault orderby for data lists (overrides orderby for data lists)expression

Delete

Option Short Description Value See Also
delete_nexttarget for redirection after deleteURL
ondelete_cascadeHook to perform cascade actions before deletefunction
ondeleteHook to perform post-delete actionsfunction

Super-Entities

Option Short Description Value See Also
super_entitySet tablename of Super-Entity tableString (or tuple of strings)Super-Entities
%s_fieldsDefine field mapping for Super-EntityDictDefining a Super-Entity Instance

Auth

Option Short Description Value See Also
realm_componentsDefines realm to be updated when realm_entity field is updatedList of stringsOrgAuth
realm_entityFunction to determine realm_entity field (unless a global function has been defined)function returning a pe_idOrgAuth
owner_groupSets the owner group for the table - either through a function or directly specifying the groupString or Function taking (table, row)
update_realmDetermines whether the realm of the entity should be updated when table is modifiedBooleanOrgAuth

Filter

Option Short Description Value See Also
contextAdds filters according to links to other tablesDictContext
filter_advancedAdds a button to show more/less filter optionsBoolean, or list/tuple of label and button class
filter_widgetsDefines filters to be displayed for the tableList of instances of S3 Filters
filter_clearAdds an action-link to clear the filter (False by default)Boolean, or list/tuple of label and button class
filter_formstyleProvides a custom formstyle for a FilterFormFunction returning a DIV instance
filter_submitSpecifies label and class of buttonTupleBootstrap button classes

Timeplot

Option Short Description Value See Also
timeplot_optionsDictionary of options for timeplotDictBlueprint

PDF/XLS Exports

Option Short Description Value See Also
report_hide_commentsWhether comments fields are hidden (default is False)Boolean
report_filename
report_formname
report_groupbyGroup the records by their values in this field (default is None)String (field name)

Pivot Table Reports

Option Short Description Value See Also
report_fieldsSets additional fields to be included in report base layerList of Strings (of field names) or of Tuples of (label, field name)
report_optionsStorage of: rows, cols, fact, methods and defaultsStorageReport Options
report_advancedAdds a button to show extra report optionsBoolean, or List/Tuple of label and button class
report_submitDetermines whether to update filters automatically, or require a submit button (default False)Boolean
report_formstyleSets formstyle for the report tableBoolean

Saved Filters / Notifications

Option Short Description Value See Also
notify_fields
notify_renderer
notify_subject
notify_template
filter_actions

Mapping

Option Short Description Value See Also
map_advancedDetermines whether to use a toggle for more/less options for the filtersBoolean, or list/tuple with labels and optional button class
map_submitDetermines whether to require a submit action to apply filtersBoolean, or list/tuple with labels/button class
marker_fnCustom marker to be added to records in the resource for the mapFunction taking record as argument
popup_edit_url URL instance
popup_url URL instance

Hierarchy

Option Short Description Value See Also
hierarchySets a field in the table as the hierarchy field (usually called "parent"), as well as category fields (if needed)None, String, or Tuple of (hierarchy_field, category_field)S3 Hierarchy

Record Merger

Option Short Description Value See Also
referenced_bySpecifies non-SQL references that may need to be updated when two duplicate records from this table are mergedList of Tuples of (tablename, fieldname)

Messaging

Option Short Description Value See Also
msg_recipient_typeDefines a custom recipient type for the message compositions filters filters (e.g. "pr_person" or "pr_group")String
msg_contact_methodSets the contact method for the table (default is "EMAIL"; other methods: "SMS" and "TWITTER")String

Profile Pages

Option Short Description Value See Also
profile_widgetsA list of widget configurations defines which widgets will be displayedList of dict() objectsWidget configuration
profile_layersA list of additional layers to be displayed on the mapList of dict() objectsProfile configuration
profile_colsSets the number of columns to display the widget across (default: 2)IntegerS3 Profile
profile_titleSets the browser page titleStringS3 Profile
profile_headerProvides the header, in web2py HTMLObject e.g. an instance of DIV() or H2()web2py HTML helpers

Record Approval

Option Short Description Value See Also
requires_approvalWhether new records need approval before being visibleBooleanRecord Approval
onapproveFunction to be run when a record is approvedFunction with (table, row) as parametersCallbacks
onrejectFunction to be run when a record is rejectedFunction with (table, row) as parametersCallbacks

XML/JSON Exports

Option Short Description Value See Also
xml_post_renderPostprocess hookFunction with (element, record) as parameters

Imports

Option Short Description Value See Also
oncommit_import_itemCallback function to log import items before committing themFunction
onconflictCustom rule for conflict resolutionFunction with (item, repository, resource) as parameters
xml_post_parseCallback function called during importFunction taking (element, record) as parameters)
deduplicateFunction for dealing with duplicates when records are being imported into the tableFunction with (item) as parameter
Note: See TracWiki for help on using the wiki.