The Application class is the base class for all Albatross application objects.
The class inherits from the ResourceMixin class to allow all application resources to be loaded once and used for every browser request. The AppContext class directs all resource related execution context method here.
The Application class introduces a number of new methods.
The base_url argument is used as the base for URLs produced by the <al-a> and <al-form> tags.
If an exception is caught then the handle_exception() method is called passing the req argument.
It creates a new execution context and formats a standard Python traceback in the locals.python_exc value, and a template interpreter traceback in the locals.html_exc value. It then tries to load the 'traceback.html' template file and execute it. This gives you the ability to control the presentation and reporting of exceptions.
If any exceptions are raised during the execution of 'traceback.html' the method writes both formatted exceptions as a <pre> formatted browser response.
TRUE
.
You should override this method in your application object if you need to validate browser requests before processing them.
It calls the get_field_names() method of the execution
context to retrieve the list of fields from the RecorderMixin
class. Any fields named by get_field_names() which are not
in the browser request will be set to None
.
If no names are returned by get_field_names() then all fields from the browser request will be merged into the local namespace of the execution context.