Data population process consists of populate steps. Each step can be marked
as active or inactive. Active steps are executed by
pyramid directive and
ptah-populate -a `` command-line script.
also it is possible to specify ``requires for each step.
is a list of steps that should be executed before step.
Interface of populate step is very simple. It is function that accepts
one argument pyramid
import ptah @ptah.populate('custom-populate-step') def populate_step(registry): ...
ptah.populate for detailed description of this directive.
Populate data during start up¶
Use ptah_populate() pyramid directive for populate system data during startup.
import ptah from pyramid.config import Configurator def main(global_settings, **settings): config = Configurator(settings=settings) config.include('ptah') ... config.ptah_populate() ... return config.make_wsgi_app()
Populate steps are executed after configration commited.