{"action":"created","issue":{"url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/131","labels_url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/131/comments","events_url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/131/events","html_url":"https://github.com/django-salesforce/django-salesforce/pull/131","id":104828179,"number":131,"title":"add range lookup functionality","user":{"login":"chromakey","id":1261962,"avatar_url":"https://avatars.githubusercontent.com/u/1261962?v=3","gravatar_id":"","url":"https://api.github.com/users/chromakey","html_url":"https://github.com/chromakey","followers_url":"https://api.github.com/users/chromakey/followers","following_url":"https://api.github.com/users/chromakey/following{/other_user}","gists_url":"https://api.github.com/users/chromakey/gists{/gist_id}","starred_url":"https://api.github.com/users/chromakey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chromakey/subscriptions","organizations_url":"https://api.github.com/users/chromakey/orgs","repos_url":"https://api.github.com/users/chromakey/repos","events_url":"https://api.github.com/users/chromakey/events{/privacy}","received_events_url":"https://api.github.com/users/chromakey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-04T04:18:31Z","updated_at":"2015-09-04T22:45:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/django-salesforce/django-salesforce/pulls/131","html_url":"https://github.com/django-salesforce/django-salesforce/pull/131","diff_url":"https://github.com/django-salesforce/django-salesforce/pull/131.diff","patch_url":"https://github.com/django-salesforce/django-salesforce/pull/131.patch"},"body":"This pull request modifies the range lookup provided by Django to render the correct SOQL code for the Salesforce API.  The reason this is needed is that Salesforce does not recognize the BETWEEN clause in SOQL.\r\n\r\nPrior to this pull request:\r\n```\r\ntoday = datetime.date.today()\r\nyesterday = today - datetime.timedelta(days=1)\r\nopportunities = Opportunity.objects.filter(close_date__range(yesterday, today))\r\n```\r\ngenerated this SQL:\r\n```\r\n'SELECT <<my_opportunity_fields>> FROM Opportunity WHERE Opportunity.close_date BETWEEN %s AND %s', (datetime.date(2015, 9, 1), datetime.date(2015, 9, 2))\r\n```\r\nThis pull request now renders this SOQL:\r\n```\r\n'SELECT <<my_opportunity_fields>> FROM Opportunity WHERE Opportunity.close_date >= %s AND Opportunity.close_date <= %s', (datetime.date(2015, 9, 1), datetime.date(2015, 9, 2))\r\n```\r\nI used the work done on the isnull lookup and this link as references.  \r\n\r\nhttps://docs.djangoproject.com/en/1.8/howto/custom-lookups/#writing-alternative-implementations-for-existing-lookups\r\n\r\nI wrote a test for it as well.  Let me know what you think.  Thanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/comments/137873542","html_url":"https://github.com/django-salesforce/django-salesforce/pull/131#issuecomment-137873542","issue_url":"https://api.github.com/repos/django-salesforce/django-salesforce/issues/131","id":137873542,"user":{"login":"philchristensen","id":181098,"avatar_url":"https://avatars.githubusercontent.com/u/181098?v=3","gravatar_id":"","url":"https://api.github.com/users/philchristensen","html_url":"https://github.com/philchristensen","followers_url":"https://api.github.com/users/philchristensen/followers","following_url":"https://api.github.com/users/philchristensen/following{/other_user}","gists_url":"https://api.github.com/users/philchristensen/gists{/gist_id}","starred_url":"https://api.github.com/users/philchristensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philchristensen/subscriptions","organizations_url":"https://api.github.com/users/philchristensen/orgs","repos_url":"https://api.github.com/users/philchristensen/repos","events_url":"https://api.github.com/users/philchristensen/events{/privacy}","received_events_url":"https://api.github.com/users/philchristensen/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T22:45:51Z","updated_at":"2015-09-04T22:45:51Z","body":"Oh shit, yeah, that was me. My bad. Thanks again for the contribution!"}}