{"action":"created","comment":{"url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/comments/35844623","id":35844623,"diff_hunk":"@@ -0,0 +1,90 @@\n+from django.db import models\n+import pytz\n+\n+\n+class JobStatus(models.Model):\n+    PENDING = 'PENDING'\n+    SUCCESS = 'SUCCESS'\n+    FAILURE = 'FAILURE'\n+    TIMEOUT = 'TIMEOUT'\n+    states = (\n+        (PENDING, 'PENDING'),\n+        (SUCCESS, 'SUCCESS'),\n+        (TIMEOUT, 'TIMEOUT'),\n+        (FAILURE, 'FAILURE')\n+    )\n+\n+    \"\"\"Job result/status.\"\"\"\n+    job_id = models.CharField(u\"job id\", max_length=255, unique=True)\n+    job_type = models.CharField(u\"job type\", max_length=255, unique=False)\n+    status = models.CharField(\n+        u\"job status\", max_length=7, default=PENDING, choices=states\n+    )\n+    result = models.TextField(null=True, default=None)\n+    date_started = models.DateTimeField(u\"started at\", auto_now_add=True)\n+    date_done = models.DateTimeField(u\"done at\", auto_now=False, null=True)\n+    traceback = models.TextField(u\"traceback\", blank=True, null=True)\n+\n+    class Meta:\n+\n+        \"\"\"Model meta-data.\"\"\"\n+        db_table = \"sqjobs_jobstatus\"\n+\n+    def to_dict(self):\n+        return {\"job_id\": self.job_id,\n+                \"job_type\": self.job_type,\n+                \"status\": self.status,\n+                \"result\": self.result,\n+                \"date_started\": self.date_done,\n+                \"date_done\": self.date_done,\n+                \"traceback\": self.traceback}\n+\n+    def __unicode__(self):\n+        return u\"<Job: %s state->%s>\" % (self.job_id, self.status)\n+\n+\n+class PeriodicJob(models.Model):\n+    PROGRAMMED_DATE = 'sqjobs_programmed_date'\n+    DELAYED_JOB = 'sqjobs_delayed_job'\n+\n+    name = models.CharField(u\"name\", max_length=255, unique=False)\n+    task = models.CharField(u\"task\", max_length=255, unique=False)\n+    args = models.TextField(u\"args\", null=True, default=None)\n+    schedule = models.CharField(u\"schedule\", max_length=255, unique=False)\n+    timezone = models.CharField(u\"timezone\", max_length=63, unique=False, default=\"UTC\")\n+    created_on = models.DateTimeField(u\"created on\", auto_now_add=True)\n+    next_execution = models.DateTimeField(u\"next execution on\", auto_now=False)\n+    enabled = models.BooleanField(u\"enabled\", default=True)\n+    skip_jobs_if_delayed = models.BooleanField(u\"skip delayed jobs\", default=False)\n+\n+    def __init__(self, *args, **kwargs):\n+        self.skip_delayed_this_time = None","path":"sqjobs/contrib/django/djsqjobs/models.py","position":61,"original_position":61,"commit_id":"b3938bebf0e8c18b454f1efdecbf5c6e090b71b3","original_commit_id":"b3938bebf0e8c18b454f1efdecbf5c6e090b71b3","user":{"login":"igalarzab","id":529409,"avatar_url":"https://avatars.githubusercontent.com/u/529409?v=3","gravatar_id":"","url":"https://api.github.com/users/igalarzab","html_url":"https://github.com/igalarzab","followers_url":"https://api.github.com/users/igalarzab/followers","following_url":"https://api.github.com/users/igalarzab/following{/other_user}","gists_url":"https://api.github.com/users/igalarzab/gists{/gist_id}","starred_url":"https://api.github.com/users/igalarzab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalarzab/subscriptions","organizations_url":"https://api.github.com/users/igalarzab/orgs","repos_url":"https://api.github.com/users/igalarzab/repos","events_url":"https://api.github.com/users/igalarzab/events{/privacy}","received_events_url":"https://api.github.com/users/igalarzab/received_events","type":"User","site_admin":false},"body":"bool","created_at":"2015-07-30T07:23:41Z","updated_at":"2015-07-30T07:23:41Z","html_url":"https://github.com/igalarzab/sqjobs/pull/11#discussion_r35844623","pull_request_url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/comments/35844623"},"html":{"href":"https://github.com/igalarzab/sqjobs/pull/11#discussion_r35844623"},"pull_request":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11","id":40100965,"html_url":"https://github.com/igalarzab/sqjobs/pull/11","diff_url":"https://github.com/igalarzab/sqjobs/pull/11.diff","patch_url":"https://github.com/igalarzab/sqjobs/pull/11.patch","issue_url":"https://api.github.com/repos/igalarzab/sqjobs/issues/11","number":11,"state":"open","locked":false,"title":"Results backend and eager mode","user":{"login":"gnufede","id":412857,"avatar_url":"https://avatars.githubusercontent.com/u/412857?v=3","gravatar_id":"","url":"https://api.github.com/users/gnufede","html_url":"https://github.com/gnufede","followers_url":"https://api.github.com/users/gnufede/followers","following_url":"https://api.github.com/users/gnufede/following{/other_user}","gists_url":"https://api.github.com/users/gnufede/gists{/gist_id}","starred_url":"https://api.github.com/users/gnufede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnufede/subscriptions","organizations_url":"https://api.github.com/users/gnufede/orgs","repos_url":"https://api.github.com/users/gnufede/repos","events_url":"https://api.github.com/users/gnufede/events{/privacy}","received_events_url":"https://api.github.com/users/gnufede/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-16T07:19:19Z","updated_at":"2015-07-30T07:23:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c653a8785eb5ab591d8840612575a22c2d79cefd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11/commits","review_comments_url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11/comments","review_comment_url":"https://api.github.com/repos/igalarzab/sqjobs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/igalarzab/sqjobs/issues/11/comments","statuses_url":"https://api.github.com/repos/igalarzab/sqjobs/statuses/b3938bebf0e8c18b454f1efdecbf5c6e090b71b3","head":{"label":"gnufede:master","ref":"master","sha":"b3938bebf0e8c18b454f1efdecbf5c6e090b71b3","user":{"login":"gnufede","id":412857,"avatar_url":"https://avatars.githubusercontent.com/u/412857?v=3","gravatar_id":"","url":"https://api.github.com/users/gnufede","html_url":"https://github.com/gnufede","followers_url":"https://api.github.com/users/gnufede/followers","following_url":"https://api.github.com/users/gnufede/following{/other_user}","gists_url":"https://api.github.com/users/gnufede/gists{/gist_id}","starred_url":"https://api.github.com/users/gnufede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnufede/subscriptions","organizations_url":"https://api.github.com/users/gnufede/orgs","repos_url":"https://api.github.com/users/gnufede/repos","events_url":"https://api.github.com/users/gnufede/events{/privacy}","received_events_url":"https://api.github.com/users/gnufede/received_events","type":"User","site_admin":false},"repo":{"id":38737568,"name":"sqjobs","full_name":"gnufede/sqjobs","owner":{"login":"gnufede","id":412857,"avatar_url":"https://avatars.githubusercontent.com/u/412857?v=3","gravatar_id":"","url":"https://api.github.com/users/gnufede","html_url":"https://github.com/gnufede","followers_url":"https://api.github.com/users/gnufede/followers","following_url":"https://api.github.com/users/gnufede/following{/other_user}","gists_url":"https://api.github.com/users/gnufede/gists{/gist_id}","starred_url":"https://api.github.com/users/gnufede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnufede/subscriptions","organizations_url":"https://api.github.com/users/gnufede/orgs","repos_url":"https://api.github.com/users/gnufede/repos","events_url":"https://api.github.com/users/gnufede/events{/privacy}","received_events_url":"https://api.github.com/users/gnufede/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gnufede/sqjobs","description":"Simple Queue Jobs (using SQS, Simple Queue Service, from AWS)","fork":true,"url":"https://api.github.com/repos/gnufede/sqjobs","forks_url":"https://api.github.com/repos/gnufede/sqjobs/forks","keys_url":"https://api.github.com/repos/gnufede/sqjobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnufede/sqjobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnufede/sqjobs/teams","hooks_url":"https://api.github.com/repos/gnufede/sqjobs/hooks","issue_events_url":"https://api.github.com/repos/gnufede/sqjobs/issues/events{/number}","events_url":"https://api.github.com/repos/gnufede/sqjobs/events","assignees_url":"https://api.github.com/repos/gnufede/sqjobs/assignees{/user}","branches_url":"https://api.github.com/repos/gnufede/sqjobs/branches{/branch}","tags_url":"https://api.github.com/repos/gnufede/sqjobs/tags","blobs_url":"https://api.github.com/repos/gnufede/sqjobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnufede/sqjobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnufede/sqjobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnufede/sqjobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnufede/sqjobs/statuses/{sha}","languages_url":"https://api.github.com/repos/gnufede/sqjobs/languages","stargazers_url":"https://api.github.com/repos/gnufede/sqjobs/stargazers","contributors_url":"https://api.github.com/repos/gnufede/sqjobs/contributors","subscribers_url":"https://api.github.com/repos/gnufede/sqjobs/subscribers","subscription_url":"https://api.github.com/repos/gnufede/sqjobs/subscription","commits_url":"https://api.github.com/repos/gnufede/sqjobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnufede/sqjobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnufede/sqjobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnufede/sqjobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnufede/sqjobs/contents/{+path}","compare_url":"https://api.github.com/repos/gnufede/sqjobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnufede/sqjobs/merges","archive_url":"https://api.github.com/repos/gnufede/sqjobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnufede/sqjobs/downloads","issues_url":"https://api.github.com/repos/gnufede/sqjobs/issues{/number}","pulls_url":"https://api.github.com/repos/gnufede/sqjobs/pulls{/number}","milestones_url":"https://api.github.com/repos/gnufede/sqjobs/milestones{/number}","notifications_url":"https://api.github.com/repos/gnufede/sqjobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnufede/sqjobs/labels{/name}","releases_url":"https://api.github.com/repos/gnufede/sqjobs/releases{/id}","created_at":"2015-07-08T06:58:16Z","updated_at":"2015-07-08T06:58:16Z","pushed_at":"2015-07-24T20:00:18Z","git_url":"git://github.com/gnufede/sqjobs.git","ssh_url":"git@github.com:gnufede/sqjobs.git","clone_url":"https://github.com/gnufede/sqjobs.git","svn_url":"https://github.com/gnufede/sqjobs","homepage":null,"size":155,"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":"igalarzab:master","ref":"master","sha":"db239775d30f4155b257a5c2c7e69dca136b4ed6","user":{"login":"igalarzab","id":529409,"avatar_url":"https://avatars.githubusercontent.com/u/529409?v=3","gravatar_id":"","url":"https://api.github.com/users/igalarzab","html_url":"https://github.com/igalarzab","followers_url":"https://api.github.com/users/igalarzab/followers","following_url":"https://api.github.com/users/igalarzab/following{/other_user}","gists_url":"https://api.github.com/users/igalarzab/gists{/gist_id}","starred_url":"https://api.github.com/users/igalarzab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalarzab/subscriptions","organizations_url":"https://api.github.com/users/igalarzab/orgs","repos_url":"https://api.github.com/users/igalarzab/repos","events_url":"https://api.github.com/users/igalarzab/events{/privacy}","received_events_url":"https://api.github.com/users/igalarzab/received_events","type":"User","site_admin":false},"repo":{"id":28004288,"name":"sqjobs","full_name":"igalarzab/sqjobs","owner":{"login":"igalarzab","id":529409,"avatar_url":"https://avatars.githubusercontent.com/u/529409?v=3","gravatar_id":"","url":"https://api.github.com/users/igalarzab","html_url":"https://github.com/igalarzab","followers_url":"https://api.github.com/users/igalarzab/followers","following_url":"https://api.github.com/users/igalarzab/following{/other_user}","gists_url":"https://api.github.com/users/igalarzab/gists{/gist_id}","starred_url":"https://api.github.com/users/igalarzab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalarzab/subscriptions","organizations_url":"https://api.github.com/users/igalarzab/orgs","repos_url":"https://api.github.com/users/igalarzab/repos","events_url":"https://api.github.com/users/igalarzab/events{/privacy}","received_events_url":"https://api.github.com/users/igalarzab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/igalarzab/sqjobs","description":"Simple Queue Jobs (using SQS, Simple Queue Service, from AWS)","fork":false,"url":"https://api.github.com/repos/igalarzab/sqjobs","forks_url":"https://api.github.com/repos/igalarzab/sqjobs/forks","keys_url":"https://api.github.com/repos/igalarzab/sqjobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/igalarzab/sqjobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/igalarzab/sqjobs/teams","hooks_url":"https://api.github.com/repos/igalarzab/sqjobs/hooks","issue_events_url":"https://api.github.com/repos/igalarzab/sqjobs/issues/events{/number}","events_url":"https://api.github.com/repos/igalarzab/sqjobs/events","assignees_url":"https://api.github.com/repos/igalarzab/sqjobs/assignees{/user}","branches_url":"https://api.github.com/repos/igalarzab/sqjobs/branches{/branch}","tags_url":"https://api.github.com/repos/igalarzab/sqjobs/tags","blobs_url":"https://api.github.com/repos/igalarzab/sqjobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/igalarzab/sqjobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/igalarzab/sqjobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/igalarzab/sqjobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/igalarzab/sqjobs/statuses/{sha}","languages_url":"https://api.github.com/repos/igalarzab/sqjobs/languages","stargazers_url":"https://api.github.com/repos/igalarzab/sqjobs/stargazers","contributors_url":"https://api.github.com/repos/igalarzab/sqjobs/contributors","subscribers_url":"https://api.github.com/repos/igalarzab/sqjobs/subscribers","subscription_url":"https://api.github.com/repos/igalarzab/sqjobs/subscription","commits_url":"https://api.github.com/repos/igalarzab/sqjobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/igalarzab/sqjobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/igalarzab/sqjobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/igalarzab/sqjobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/igalarzab/sqjobs/contents/{+path}","compare_url":"https://api.github.com/repos/igalarzab/sqjobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/igalarzab/sqjobs/merges","archive_url":"https://api.github.com/repos/igalarzab/sqjobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/igalarzab/sqjobs/downloads","issues_url":"https://api.github.com/repos/igalarzab/sqjobs/issues{/number}","pulls_url":"https://api.github.com/repos/igalarzab/sqjobs/pulls{/number}","milestones_url":"https://api.github.com/repos/igalarzab/sqjobs/milestones{/number}","notifications_url":"https://api.github.com/repos/igalarzab/sqjobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/igalarzab/sqjobs/labels{/name}","releases_url":"https://api.github.com/repos/igalarzab/sqjobs/releases{/id}","created_at":"2014-12-14T18:56:08Z","updated_at":"2015-03-23T17:08:19Z","pushed_at":"2015-07-24T19:59:25Z","git_url":"git://github.com/igalarzab/sqjobs.git","ssh_url":"git@github.com:igalarzab/sqjobs.git","clone_url":"https://github.com/igalarzab/sqjobs.git","svn_url":"https://github.com/igalarzab/sqjobs","homepage":null,"size":682,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11"},"html":{"href":"https://github.com/igalarzab/sqjobs/pull/11"},"issue":{"href":"https://api.github.com/repos/igalarzab/sqjobs/issues/11"},"comments":{"href":"https://api.github.com/repos/igalarzab/sqjobs/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/igalarzab/sqjobs/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/igalarzab/sqjobs/statuses/b3938bebf0e8c18b454f1efdecbf5c6e090b71b3"}}}}