-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 Refactor code base to be modular for additional entities #26
Conversation
Create common module for common code among resources Separate out model code, resource code, serialization code for Person resources Create new folder for person tests, move all person tests into it
dataservice/api/__init__.py
Outdated
from flask_restplus import Api | ||
from .person import person_api | ||
|
||
api = Api(title='Kids First Data Service', | ||
api_v1 = Blueprint('api', __name__, url_prefix='/api/v1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably host under api.kids-first.io
. We can use /v1
for versioning, but let's drop the /api
for now.
dataservice/api/common/model.py
Outdated
@@ -1,9 +1,9 @@ | |||
from sqlalchemy.ext.declarative import declared_attr | |||
|
|||
from datetime import datetime | |||
from . import db | |||
from dataservice import db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change from relative to absolute imports? Should probably stay consistent throughout the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok as just discussed, we're going with absolute imports. Will make the necessary changes
dataservice/commands.py
Outdated
|
||
HERE = os.path.abspath(os.path.dirname(__file__)) | ||
PROJECT_ROOT = os.path.join(HERE, os.pardir) | ||
TEST_PATH = os.path.join(PROJECT_ROOT, 'tests') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I'll remove them
We can also remove flask-script from |
Remove unused constants in commands.py Remove deploy command - it is obsolete since flask CLI has a way to run db upgrade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.