Skip to content
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

Consider adding to the readme an example of using API modifying goal #4

Open
matkoniecz opened this issue Jan 3, 2020 · 0 comments

Comments

@matkoniecz
Copy link
Contributor

matkoniecz commented Jan 3, 2020

Currently it is not obvious to me how to do this using this library

I found

def update_goal(self, goal_name, slug=None, title=None, yaxis=None, secret=None,
that allows to do this with some subset of parameters.

    pyminder = Pyminder(user='[your username - dummy field]', token=token())
    pyminder._beeminder.update_goal("ping_babcia", title="ping_babcia_description")

works, but is using internal _ prefixed things.

And to edit arbitrary parameters following terribleness works, but I hope for something nicer.

    pyminder = Pyminder(user='[your username - dummy field]', token=token())
    #pyminder._beeminder.update_goal("ping_babcia", title="ping_babcia_description")
    goal_name = "ping_babcia"
    endpoint = f'users/{pyminder._beeminder._user}/goals/{goal_name}.json'
    data = {"fineprint": "test fineprint", "title": "ping_babcia_description"}
    pyminder._beeminder._call(endpoint, data=data, method="PUT")

And thanks for a publishing this library, it saved me some time that would be needed to write it on my own!

@matkoniecz matkoniecz changed the title Consider adding to the readme an example of using API modyfying goal Consider adding to the readme an example of using API modifying goal Jan 3, 2020
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

No branches or pull requests

1 participant