Skip to content

Conversation

@jcampbell
Copy link
Contributor

Sets the default value of PAGE_SIZE for the Api object when it is initialized using a Flask app (as it is in current documentation examples).

Sets the default value of PAGE_SIZE for the Api object when it is initialized using a Flask app (as it is in current documentation examples).
@akira-dev
Copy link
Collaborator

I can't merge this PR until continuous integration test fails. Please fix tests if you want to include this fix soon.

@jpcampb2
Copy link

jpcampb2 commented Nov 3, 2017

I adjusted Api's init to create a default Flask object if no app is provided.

@coveralls
Copy link

coveralls commented Nov 3, 2017

Coverage Status

Coverage decreased (-0.2%) to 94.186% when pulling 752052d on jcampbell:patch-1 into 6ab02ab on miLibris:master.

"""

if app is None:
app = Flask(__name__)
Copy link
Contributor

@hellupline hellupline Nov 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this is a good idea:

If the user create a instance of the jsonapi, then configure it using self.init_app(app):
the user would have created a second Flask app,

instead, __init__ shoud try to call init_app if app is not None.
also, calling init_app on __init__ would solve the first issue, to set default PAGE_SIZE

@jcampbell
Copy link
Contributor Author

Thanks, @hellupline. Closing this as irrelevant now based on your new pull request.

@jcampbell jcampbell closed this Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants