= Custom Tables = Templates can define their own custom models without needing to touch the core code. 1. Create a file with S3Model(s) in, just as if it was going into {{{s3db/}}} although change the s3 import path to {{{from s3 import *}}} 2. Add this to {{{mytemplate/__init__.py}}}, e.g. for a module called 'custom': {{{ __all__ = ("custom", ) import templates.mytemplate.custom }}} 3. Add to {{{mytemplate/config.py}}}: {{{ settings.base.custom_models = {"custom": "mytemplate", } settings.modules["custom"] = {"name_nice": T("My Custom Module"), "module_type": 10} }}} 4. If wanting to have a REST controller for them, then see [wiki:S3/S3REST/s3_rest_controller#Re-RoutingControllers] i.e. add an entry to {{{mytemplate/config.py}}}: {{{ settings.base.rest_controllers = {("custom", resourcename): ("custom", resourcename)} }}}