= Table Configuration Settings = [[TOC]] - '''TO BE COMPLETED''' == CRUD == === General === These options affect all interactive CRUD functions: ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''insertable''||whether new records can be inserted into the table||boolean|| || ||''editable''||whether records in the table can be edited||boolean|| || ||''deletable''||whether records in the table can be deleted||boolean|| || === Forms === These options are relevant for CRUD forms: ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''subheadings''||Subheadings to insert into CRUD forms||structure|| || ||''mark_required''||Enforce fields to be marked as required in forms||list of field names|| || ||''onvalidation''||Hook to validate records||function|| || ||''create_onvalidation''||Hook to validate new records (overrides onvalidation for create)||function|| || ||''update_onvalidation''||Hook to validate record updates (overrides onvalidation for update)||function|| || ||''onaccept''||Hook to perform post-commit actions||function|| || ||''create_onaccept''||Hook to perform post-commit actions for new records (overrides onaccept for create)||function|| || ||''update_onaccept''||Hook to perform post-commit actions for record updates (overrides onaccept for update)||function|| || ||''create_next''||target for redirection after successful create||URL|| || ||''update_next''||target for redirection after successful update||URL|| || ||''post_process''||post-process hook for old {{{EmbeddedComponentWidget}}} (no longer used)||function|| || === Data Tables / Data Lists === ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''list_fields''||fields to show in data tables / lists||list of field names|| || ||''linkto''||URL to link the ID column in data tables to (usually overridden by s3.actions)||URL|| || ||''linkto_update''||URL to link the ID column in data tables to (overrides linkto if the user is permitted to update)||URL|| || ||''extra_fields''||fields 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|| || ||''listadd''||whether to provide an embedded create-form in data table views||boolean|| || ||''addbtn''||whether to show a button for adding a record to the table||boolean|| || ||''list_layout''||card renderer for data lists||function or class|| || ||''orderby''||default orderby for data tables/lists||expression|| || ||''list_orderby''||default orderby for data lists (overrides orderby for data lists)||expression|| || === Delete === ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''delete_next''||target for redirection after delete||URL|| || ||''ondelete_cascade''||Hook to perform cascade actions before delete||function|| || ||''ondelete''||Hook to perform post-delete actions||function|| || == Super-Entities == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''super_entity''||Set tablename of Super-Entity table||String (or tuple of strings)||[wiki:S3/S3Model/SuperEntities Super-Entities]|| ||''%s_fields''||Define field mapping for Super-Entity||Dict||[wiki:S3/S3Model/SuperEntities#DefininganInstanceofaSuper-Entity Defining a Super-Entity Instance]|| == Auth == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''realm_components''||Defines realm to be updated when realm_entity field is updated||List of strings||[wiki:S3/S3AAA/OrgAuth OrgAuth]|| ||''realm_entity''||Function to determine realm_entity field (unless a global function has been defined)||function returning a pe_id||[wiki:S3/S3AAA/OrgAuth OrgAuth]|| ||''owner_group''||Sets the owner group for the table - either through a function or directly specifying the group||String or Function taking (table, row)|| || ||''update_realm''||Determines whether the realm of the entity should be updated when table is modified||Boolean||[wiki:S3/S3AAA/OrgAuth OrgAuth]|| == Filter == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''context''||Adds filters according to links to other tables||Dict||[wiki:S3/Context Context]|| ||''filter_advanced''||Adds a button to show more/less filter options||Boolean, or list/tuple of label and button class|| || ||''filter_widgets''||Defines filters to be displayed for the table||List of instances of S3 Filters|| || ||''filter_clear''||Adds an action-link to clear the filter (False by default)||Boolean, or list/tuple of label and button class|| || ||''filter_formstyle''||Provides a custom formstyle for a !FilterForm||Function returning a DIV instance|| || ||''filter_submit''||Specifies label and class of button||Tuple||[http://getbootstrap.com/css/#buttons Bootstrap button classes]|| == Timeplot == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''timeplot_options''||Dictionary of options for timeplot||Dict||[wiki:BluePrint/TimePlot Blueprint]|| == PDF/XLS Exports == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''report_hide_comments''||Whether comments fields are hidden (default is False)||Boolean|| || ||''report_filename''|| || || || ||''report_formname''|| || || || ||''report_groupby''||Group the records by their values in this field (default is None)||String (field name)|| || == Pivot Table Reports == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''report_fields''||Sets additional fields to be included in report base layer||List of Strings (of field names) or of Tuples of (label, field name)|| || ||''report_options''||Dict of: rows, cols, fact, methods and defaults||dict||[wiki:S3/S3Report#ReportOptions Report Options]|| ||''report_advanced''||Adds a button to show extra report options||Boolean, or !List/Tuple of label and button class|| || ||''report_submit''||Determines whether to update filters automatically, or require a submit button (default False)||Boolean|| || ||''report_formstyle''||Sets formstyle for the report table||Boolean|| || == Saved Filters / Notifications == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''notify_fields''||Fields to extract for notifications (like list_fields)||List of fields, or of Tuples of (field, label)||[wiki:S3/Notifications#PerResource Notifications]|| ||''notify_renderer''||Overrides the default pre-render function, which prepares the message contents for the message template||Function||[wiki:S3/Notifications#MessageTemplates Notifications]|| ||''notify_subject''||Custom subject line for messages||String|| || ||''notify_template''||Specifies a custom html template to be used for the message||String||[wiki:S3/Notifications#MessageTemplates Templates]|| ||''filter_actions''||Sets a list of actions that can be used in constructing a custom action bar|| || || == Mapping == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''map_advanced''||Determines whether to use a toggle for more/less options for the filters||Boolean, or list/tuple with labels and optional button class|| || ||''map_submit''||Determines whether to require a submit action to apply filters||Boolean, or list/tuple with labels/button class|| || ||''marker_fn''||Custom marker to be added to records in the resource for the map||Function taking record as argument|| || ||''popup_edit_url''|| ||URL instance|| || ||''popup_url''|| ||URL instance|| || == Hierarchy == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''hierarchy''||Sets 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)||[wiki:S3/S3Hierarchy S3 Hierarchy]|| == Record Merger == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''referenced_by''||Specifies non-SQL references that may need to be updated when two duplicate records from this table are merged||List of Tuples of (tablename, fieldname)|| || == Messaging == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''msg_recipient_type''||Defines a custom recipient type for the message compositions filters filters (e.g. "pr_person" or "pr_group")||String|| || ||''msg_contact_method''||Sets the contact method for the table (default is "EMAIL"; other methods: "SMS" and "TWITTER")||String|| || == Profile Pages == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''profile_widgets''||A list of widget configurations defines which widgets will be displayed||List of dict() objects||[wiki:S3/S3Profile#Widgetconfiguration Widget configuration]|| ||''profile_layers''||A list of additional layers to be displayed on the map||List of dict() objects||[wiki:S3/S3Profile#Configuration Profile configuration]|| ||''profile_cols''||Sets the number of columns to display the widget across (default: 2)||Integer||[wiki:S3/S3Profile S3 Profile]|| ||''profile_title''||Sets the browser page title||String||[wiki:S3/S3Profile S3 Profile]|| ||''profile_header''||Provides the header, in web2py HTML||Object e.g. an instance of DIV() or H2()||[http://web2py.com/books/default/chapter/29/05/the-views#Built-in-helpers web2py HTML helpers]|| == Record Approval == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''requires_approval''||Whether new records need approval before being visible||Boolean||[wiki:S3/S3AAA/RecordApproval Record Approval]|| ||''onapprove''||Function to be run when a record is approved||Function with (table, row) as parameters||[wiki:S3/S3AAA/RecordApproval#Callbacks Callbacks]|| ||''onreject''||Function to be run when a record is rejected||Function with (table, row) as parameters||[wiki:S3/S3AAA/RecordApproval#Callbacks Callbacks]|| == XML/JSON Exports == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''xml_post_render''||Postprocess hook||Function with (element, record) as parameters|| || == Imports == ||= '''Option''' =||= '''Short Description''' =||= '''Value''' =||= '''See Also''' =|| ||''oncommit_import_item''||Callback function to log import items before committing them||Function|| || ||''onconflict''||Custom rule for conflict resolution||Function with (item, repository, resource) as parameters|| || ||''xml_post_parse''||Callback function called during import||Function taking (element, record) as parameters)|| || ||''deduplicate''||Function for dealing with duplicates when records are being imported into the table||Function with (item) as parameter|| ||