-
Notifications
You must be signed in to change notification settings - Fork 7
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
newtask endpoint for pbclient API #34
base: master
Are you sure you want to change the base?
Conversation
Forgot to write test. Update will come soon |
We never add it because we use that only from the front end :-) Good add! Once the tests pass, we will merge it and publish it. Please, increase the version number as well on the setup.py file. |
We want to launch pybossa as a service, so we need to upgrade the client to cover most of the API. Do you think I should increase the version for each PR? And which part of the version? |
This one is a minor improvement, so go for x.x.Y :-) Then, if you change anything big, we can move it into x.X.x and if we do something muuuch bigger into X.x.x. |
Please, don't rush with merging it. I made some enhancements. BTW the coveralls isn't in rush anyway 🤣 |
Yes, Coveralls usually goes really slow or returns something not good. In any case, we keep it as a way of reviewing if we miss something important. |
pbclient/__init__.py
Outdated
@@ -454,6 +454,34 @@ def get_tasks(project_id, limit=100, offset=0, last_id=None): | |||
raise | |||
|
|||
|
|||
def get_new_task(project_id, limit=1, offset=0, last_id=None): |
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.
I decided to drop params: limit, offset and last_id. These parameters are relevant only for getting multiple tasks. It just doesn't apply when you want to get a random task.
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.
I need your opinion on this one: is it desired use case to send multiple new tasks at once?
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.
Yes. It will be nice to add it. Basically think about this of getting a bunch of tasks for your user with only one request. It will save time and you can cache them.
Heya! |
Missing enpoint in pbclient API is getting a new task, selected by pybossa. Very similar to get tasks list