{"action":"created","issue":{"url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/40","repository_url":"https://api.github.com/repos/ashcrow/flask-track-usage","labels_url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/40/comments","events_url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/40/events","html_url":"https://github.com/ashcrow/flask-track-usage/pull/40","id":316412371,"number":40,"title":"speculative changes; adding user_defined variable field to storage","user":{"login":"JohnAD","id":5799303,"avatar_url":"https://avatars1.githubusercontent.com/u/5799303?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAD","html_url":"https://github.com/JohnAD","followers_url":"https://api.github.com/users/JohnAD/followers","following_url":"https://api.github.com/users/JohnAD/following{/other_user}","gists_url":"https://api.github.com/users/JohnAD/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAD/subscriptions","organizations_url":"https://api.github.com/users/JohnAD/orgs","repos_url":"https://api.github.com/users/JohnAD/repos","events_url":"https://api.github.com/users/JohnAD/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-20T21:09:01Z","updated_at":"2018-04-23T15:27:40Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ashcrow/flask-track-usage/pulls/40","html_url":"https://github.com/ashcrow/flask-track-usage/pull/40","diff_url":"https://github.com/ashcrow/flask-track-usage/pull/40.diff","patch_url":"https://github.com/ashcrow/flask-track-usage/pull/40.patch"},"body":"This is purely speculative.\r\n\r\nBut I suspect this might be a compelling thing to use in this library. To put in context why, I did a quick retake of the video intro:\r\n\r\nhttps://youtu.be/bd7__OGGgGY   (unlisted)\r\n\r\nEssentially, this adds support for new dictionary variable in `g` called `g.track_var`. The user can now place _any_ kind of data into the dictionary. On a SQL storage, it should create a JSON string of the dictionary. On Mongo storage, it should store the dictionary as-is.\r\n\r\nI've only fully tested MongoEngine, but have the basics elsewhere. I've speculatively updated the `app.py` example in the demo to show it's usage. See https://github.com/JohnAD/flask-track-usage-mongoengine-demo/blob/master/app.py\r\n\r\nDoes this sound like a good addition for 2.0? It does add extra fields to the SQL Storage so it is a breaking upgrade as the user would need to update the structure of the table.\r\n\r\nTwo other minor changes:\r\n\r\n* also added 'username' to the SQL storage\r\n* changed the `get_usage` name of `date` to `datetime` to match up with the SQL fieldname."},"comment":{"url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/comments/383616357","html_url":"https://github.com/ashcrow/flask-track-usage/pull/40#issuecomment-383616357","issue_url":"https://api.github.com/repos/ashcrow/flask-track-usage/issues/40","id":383616357,"user":{"login":"JohnAD","id":5799303,"avatar_url":"https://avatars1.githubusercontent.com/u/5799303?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAD","html_url":"https://github.com/JohnAD","followers_url":"https://api.github.com/users/JohnAD/followers","following_url":"https://api.github.com/users/JohnAD/following{/other_user}","gists_url":"https://api.github.com/users/JohnAD/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAD/subscriptions","organizations_url":"https://api.github.com/users/JohnAD/orgs","repos_url":"https://api.github.com/users/JohnAD/repos","events_url":"https://api.github.com/users/JohnAD/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAD/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T15:27:40Z","updated_at":"2018-04-23T15:27:40Z","author_association":"NONE","body":"> > Does this sound like a good addition for 2.0? It does add extra fields to the SQL Storage so it is a breaking upgrade as the user would need to update the structure of the table.\r\n> \r\n> I think so ... though is it truly a breaking change for old users? I'd think that if they don't use the new g.track_var they wouldn't be broken. We may also be able to upgrade the schema if it is missing fields (that could be done by you or I in a follow on before 2.0.0 release).\r\n\r\nThat is a good idea. I'll admit my weakness with SQLAlchemy, though. Do you think you could write the automatic schema change?"}}
{"actor":{"display_login":"JohnAD"}}