{"action":"created","comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/77065411","id":77065411,"diff_hunk":"@@ -0,0 +1,80 @@\n+\"\"\"\n+Custom django fields provided by pulp platform\n+\"\"\"\n+import json\n+\n+from django.core.exceptions import ValidationError\n+from django.db import models\n+from django.utils.translation import six, ugettext_lazy as _\n+\n+\n+class JSONField(models.TextField):\n+    \"\"\"\n+    A custom django field to serialize dicts into a text field","path":"platform/pulp/platform/fields.py","position":13,"original_position":13,"commit_id":"c306d9f1ff257a0ac911105d9e92fe11418c7e58","original_commit_id":"c306d9f1ff257a0ac911105d9e92fe11418c7e58","user":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"body":"s/django/Django/\r\ns/text field/text field and vice versa/","created_at":"2016-08-31T20:21:40Z","updated_at":"2016-08-31T20:21:40Z","html_url":"https://github.com/pulp/pulp/pull/2699#discussion_r77065411","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/2699","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/77065411"},"html":{"href":"https://github.com/pulp/pulp/pull/2699#discussion_r77065411"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2699"}}},"pull_request":{"url":"https://api.github.com/repos/pulp/pulp/pulls/2699","id":81219452,"html_url":"https://github.com/pulp/pulp/pull/2699","diff_url":"https://github.com/pulp/pulp/pull/2699.diff","patch_url":"https://github.com/pulp/pulp/pull/2699.patch","issue_url":"https://api.github.com/repos/pulp/pulp/issues/2699","number":2699,"state":"open","locked":false,"title":"Add task models","user":{"login":"pcreech","id":2792636,"avatar_url":"https://avatars.githubusercontent.com/u/2792636?v=3","gravatar_id":"","url":"https://api.github.com/users/pcreech","html_url":"https://github.com/pcreech","followers_url":"https://api.github.com/users/pcreech/followers","following_url":"https://api.github.com/users/pcreech/following{/other_user}","gists_url":"https://api.github.com/users/pcreech/gists{/gist_id}","starred_url":"https://api.github.com/users/pcreech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcreech/subscriptions","organizations_url":"https://api.github.com/users/pcreech/orgs","repos_url":"https://api.github.com/users/pcreech/repos","events_url":"https://api.github.com/users/pcreech/events{/privacy}","received_events_url":"https://api.github.com/users/pcreech/received_events","type":"User","site_admin":false},"body":"Add task models.\r\n\r\nThe tasking system is a pretty solid, well baked solution, so making too many changes at this time might not make sense.  I tried to make ones that made sense in relation to utilizing a relational database.\r\n\r\nUtilized foreign keys where it appears to make sense, and converted some of the data types to utilize their natural data state in the database (mainly DateTimes)\r\n\r\nThere are four fields that will need more thought, but wanted to go ahead and put up the PR to start the conversation. These fields store complex data structures, that could potentially vary based on utilization.  \r\n\r\nThese are:\r\n- Task.result\r\n- Task.error\r\n- ScheduledCalls.args\r\n- ScheduledCalls.kwargs\r\n\r\nMy initial thought was to convert them into properties, so we can split up the internal representation (TextField) with an external implementation of some type of complex object.  This should be transparent for the user, as when they use \"scheduled_call.args\" it should execute the code in the property function.  Currently the implementation is a naive example implementation utilizing json.dumps, that will need to be fleshed out.  \r\n\r\nWith that, I'm also looking into how creating a custom Django field (Michael's suggestion) could provide the same functionality.  It appears to provide a more natural interface for converting between database state and python state.  Brian suggested utilizing django.picklefield.  This is a viable and enticing option, but would become another dependency we would have to manage.  We should probably weigh the cost of developing our own solution with the cost of introducing another dependency.\r\n\r\ncloses [#2087](https://pulp.plan.io/issues/2087)","created_at":"2016-08-13T16:14:01Z","updated_at":"2016-08-31T20:21:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7126bfc388b2e58f458a604a9a767c9f1ce774d","assignee":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"assignees":[{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},{"login":"jortel","id":1126767,"avatar_url":"https://avatars.githubusercontent.com/u/1126767?v=3","gravatar_id":"","url":"https://api.github.com/users/jortel","html_url":"https://github.com/jortel","followers_url":"https://api.github.com/users/jortel/followers","following_url":"https://api.github.com/users/jortel/following{/other_user}","gists_url":"https://api.github.com/users/jortel/gists{/gist_id}","starred_url":"https://api.github.com/users/jortel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jortel/subscriptions","organizations_url":"https://api.github.com/users/jortel/orgs","repos_url":"https://api.github.com/users/jortel/repos","events_url":"https://api.github.com/users/jortel/events{/privacy}","received_events_url":"https://api.github.com/users/jortel/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pulp/pulp/pulls/2699/commits","review_comments_url":"https://api.github.com/repos/pulp/pulp/pulls/2699/comments","review_comment_url":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pulp/pulp/issues/2699/comments","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/c306d9f1ff257a0ac911105d9e92fe11418c7e58","head":{"label":"pcreech:3.0-dev-2087","ref":"3.0-dev-2087","sha":"c306d9f1ff257a0ac911105d9e92fe11418c7e58","user":{"login":"pcreech","id":2792636,"avatar_url":"https://avatars.githubusercontent.com/u/2792636?v=3","gravatar_id":"","url":"https://api.github.com/users/pcreech","html_url":"https://github.com/pcreech","followers_url":"https://api.github.com/users/pcreech/followers","following_url":"https://api.github.com/users/pcreech/following{/other_user}","gists_url":"https://api.github.com/users/pcreech/gists{/gist_id}","starred_url":"https://api.github.com/users/pcreech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcreech/subscriptions","organizations_url":"https://api.github.com/users/pcreech/orgs","repos_url":"https://api.github.com/users/pcreech/repos","events_url":"https://api.github.com/users/pcreech/events{/privacy}","received_events_url":"https://api.github.com/users/pcreech/received_events","type":"User","site_admin":false},"repo":{"id":48134365,"name":"pulp","full_name":"pcreech/pulp","owner":{"login":"pcreech","id":2792636,"avatar_url":"https://avatars.githubusercontent.com/u/2792636?v=3","gravatar_id":"","url":"https://api.github.com/users/pcreech","html_url":"https://github.com/pcreech","followers_url":"https://api.github.com/users/pcreech/followers","following_url":"https://api.github.com/users/pcreech/following{/other_user}","gists_url":"https://api.github.com/users/pcreech/gists{/gist_id}","starred_url":"https://api.github.com/users/pcreech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcreech/subscriptions","organizations_url":"https://api.github.com/users/pcreech/orgs","repos_url":"https://api.github.com/users/pcreech/repos","events_url":"https://api.github.com/users/pcreech/events{/privacy}","received_events_url":"https://api.github.com/users/pcreech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pcreech/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":true,"url":"https://api.github.com/repos/pcreech/pulp","forks_url":"https://api.github.com/repos/pcreech/pulp/forks","keys_url":"https://api.github.com/repos/pcreech/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pcreech/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pcreech/pulp/teams","hooks_url":"https://api.github.com/repos/pcreech/pulp/hooks","issue_events_url":"https://api.github.com/repos/pcreech/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pcreech/pulp/events","assignees_url":"https://api.github.com/repos/pcreech/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pcreech/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pcreech/pulp/tags","blobs_url":"https://api.github.com/repos/pcreech/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pcreech/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pcreech/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pcreech/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pcreech/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pcreech/pulp/languages","stargazers_url":"https://api.github.com/repos/pcreech/pulp/stargazers","contributors_url":"https://api.github.com/repos/pcreech/pulp/contributors","subscribers_url":"https://api.github.com/repos/pcreech/pulp/subscribers","subscription_url":"https://api.github.com/repos/pcreech/pulp/subscription","commits_url":"https://api.github.com/repos/pcreech/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pcreech/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pcreech/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pcreech/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pcreech/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pcreech/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pcreech/pulp/merges","archive_url":"https://api.github.com/repos/pcreech/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pcreech/pulp/downloads","issues_url":"https://api.github.com/repos/pcreech/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pcreech/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pcreech/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pcreech/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pcreech/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pcreech/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/pcreech/pulp/deployments","created_at":"2015-12-16T20:48:58Z","updated_at":"2016-01-11T16:05:20Z","pushed_at":"2016-08-31T19:29:07Z","git_url":"git://github.com/pcreech/pulp.git","ssh_url":"git@github.com:pcreech/pulp.git","clone_url":"https://github.com/pcreech/pulp.git","svn_url":"https://github.com/pcreech/pulp","homepage":"","size":91983,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pulp:3.0-dev","ref":"3.0-dev","sha":"28029cdc59fb5b8aef3975464df498a6496f9138","user":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"repo":{"id":5314652,"name":"pulp","full_name":"pulp/pulp","owner":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pulp/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":false,"url":"https://api.github.com/repos/pulp/pulp","forks_url":"https://api.github.com/repos/pulp/pulp/forks","keys_url":"https://api.github.com/repos/pulp/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pulp/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pulp/pulp/teams","hooks_url":"https://api.github.com/repos/pulp/pulp/hooks","issue_events_url":"https://api.github.com/repos/pulp/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pulp/pulp/events","assignees_url":"https://api.github.com/repos/pulp/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pulp/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pulp/pulp/tags","blobs_url":"https://api.github.com/repos/pulp/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pulp/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pulp/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pulp/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pulp/pulp/languages","stargazers_url":"https://api.github.com/repos/pulp/pulp/stargazers","contributors_url":"https://api.github.com/repos/pulp/pulp/contributors","subscribers_url":"https://api.github.com/repos/pulp/pulp/subscribers","subscription_url":"https://api.github.com/repos/pulp/pulp/subscription","commits_url":"https://api.github.com/repos/pulp/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pulp/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pulp/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pulp/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pulp/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pulp/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pulp/pulp/merges","archive_url":"https://api.github.com/repos/pulp/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pulp/pulp/downloads","issues_url":"https://api.github.com/repos/pulp/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pulp/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pulp/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pulp/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pulp/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pulp/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/pulp/pulp/deployments","created_at":"2012-08-06T13:49:20Z","updated_at":"2016-08-22T13:25:35Z","pushed_at":"2016-08-31T19:29:08Z","git_url":"git://github.com/pulp/pulp.git","ssh_url":"git@github.com:pulp/pulp.git","clone_url":"https://github.com/pulp/pulp.git","svn_url":"https://github.com/pulp/pulp","homepage":"","size":102798,"stargazers_count":277,"watchers_count":277,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":18,"forks":113,"open_issues":18,"watchers":277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2699"},"html":{"href":"https://github.com/pulp/pulp/pull/2699"},"issue":{"href":"https://api.github.com/repos/pulp/pulp/issues/2699"},"comments":{"href":"https://api.github.com/repos/pulp/pulp/issues/2699/comments"},"review_comments":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2699/comments"},"review_comment":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2699/commits"},"statuses":{"href":"https://api.github.com/repos/pulp/pulp/statuses/c306d9f1ff257a0ac911105d9e92fe11418c7e58"}}}}
{"actor":{"display_login":"bmbouter"}}