'Invoke the customization callback for a resource.
@param tablename: the tablename of the resource; if called
without tablename it will invoke the callbacks
for the target resources of this request:
- master
- active component
- active link table
(in this order)
Resource customization functions can be defined like:
def customise_resource_my_table(r, tablename):
current.s3db.configure(tablename,
my_custom_setting = "example")
return
settings.customise_resource_my_table =                                         customise_resource_my_table
@note: the hook itself can call r.customise_resource in order
to cascade customizations as necessary
@note: if a table is customised that is not currently loaded,
then it will be loaded for this process'

def customise_resource(self, tablename=None):

    if (tablename is None):
        customise = self.customise_resource
        customise(self.resource.tablename)
        component = self.component
        if component:
            customise(component.tablename)
        link = self.link
        if link:
            customise(link.tablename)
    else:
        db = current.db
        if (tablename not in db):
            current.s3db.table(tablename)
        customise = current.deployment_settings.customise_resource(tablename)
        if customise:
            customise(self, tablename)
