Page MenuHomePhabricator

[backend] Add a shell context processor
Closed, InvalidPublic

Description

Add it to the create_app() factory function in api/__init__.py. Basically, the exact same thing as here: https://github.com/blancadesal/flask-blueprint/blob/main/api/__init__.py

Related Objects

Event Timeline

Question about this one. I've used the flask shell a lot to play around with adding things to the db. I've never actually had to "import db" for that. The things I've mostly needed are, for instance, all of the functions from populate_db.py, so from jobs import populate_db or, even better, from jobs.populate_db import get_single_tool, populate_db. I also work a lot with the models, so from api.models import Task, Field, Tool

But in order to set this up in api/__init__.py I would need to import all of these things that I normally wouldn't import into that file.... so it's okay if I do that and have a bunch of imports in that file that are only there for the purpose of building the shell context processor?

@Slst2020 and I have decided that we don't need this at the moment.