Add some more "handler" docs

app handler, batch handlers, native batch types, people handler
This commit is contained in:
Lance Edgar 2021-08-18 12:49:40 -05:00
parent 0726a70192
commit 84477e5e36
30 changed files with 397 additions and 29 deletions

View file

@ -0,0 +1,23 @@
App Handler
===========
There is one handler which corresponds to the app itself, whereas all
other handlers correspond to some "portion" of the app. This main app
handler's primary purpose is to:
- provide a common interface for obtaining all other handlers
- provide some "global" methods, e.g. for rendering date/time values
You can override the main app handler, with config like:
.. code-block:: ini
[rattail]
app.handler = poser.app:PoserAppHandler
Of course that must point to a valid ``AppHandler`` class, which you
probably must create.
See also :class:`rattail:rattail.app.AppHandler` which is the default
and base class.

View file

@ -0,0 +1,15 @@
Batch Handlers
==============
There is a handler for each unique "type" of batch which exists in the
app. For instance the Pricing Batch has its own handler, and so does
the Inventory Batch, and the Purchase Batch, and so on.
See :doc:`/data/batch/handlers` for some more background on these.
See :doc:`/data/batch/native/index` for a list of natively-supported
batch types. (Again, there is a handler for each type.)
See also :class:`rattail:rattail.batch.handlers.BatchHandler` which is
the base class for all batch handlers.

View file

@ -0,0 +1,7 @@
Import Handlers
===============
TODO
* :doc:`/data/importing/index`

View file

@ -0,0 +1,24 @@
Handlers
========
Rattail uses the concept of a "handler" to allow for two things primarily:
- customization of app logic without "forking" Rattail package(s)
- keep logic in a "single" place which can be leverage by multiple UIs
The idea is that for various aspects of an app, there will be one and
only one "handler" which is responsible for the business logic.
Rattail usually comes with a default handler, which will be used
unless you've created your own handler and configured it to be used
instead.
.. toctree::
:maxdepth: 2
:caption: Contents:
app
batch
import
other/index

View file

@ -0,0 +1,5 @@
Board Handler
=============
TODO

View file

@ -0,0 +1,5 @@
Clientele Handler
=================
TODO

View file

@ -0,0 +1,5 @@
Email Handler
=============
TODO

View file

@ -0,0 +1,5 @@
Employment Handler
==================
TODO

View file

@ -0,0 +1,5 @@
Feature Handler
===============
TODO

View file

@ -0,0 +1,20 @@
Other / Misc. Handlers
======================
Here are some handlers which are specific to various aspects of the
business logic, or a particular feature etc.
.. toctree::
:maxdepth: 2
:caption: Contents:
board
clientele
email
employment
feature
people
products
report

View file

@ -0,0 +1,19 @@
People Handler
==============
This handler is responsible for business logic surrounding the
:class:`~rattail:rattail.db.model.people.Person` model.
You can obtain a reference to the configured handler via
:meth:`~rattail:rattail.app.AppHandler.get_people_handler`.
You may override the default handler with config like:
.. code-block:: ini
[rattail]
people.handler = poser.people:PoserPeopleHandler
The default handler is :class:`rattail:rattail.people.PeopleHandler` -
see its documentation for a list of methods you can override.

View file

@ -0,0 +1,5 @@
Products Handler
================
TODO

View file

@ -0,0 +1,7 @@
Report Handler
==============
TODO
* :doc:`/data/reports/handler`