by sdenton4 · 3y ago · 0 comments
# jobs.py
@scheduler.register_job(when=“daily”)
def batch_job(): …
This adds the job to the global scheduler. # models.py
class Model(DBModel):
def on_change():
# do stuff
This adds the model to the ORM’s list of modules via a metaclasss and registers its hooks. # plugin.py
class SomePlugin(PluginBase): …
Same thing. The code to load plugins like this is just importing the module and letting the metaclass do the work.