{"action":"opened","issue":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/issues/1091","labels_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/issues/1091/labels{/name}","comments_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/issues/1091/comments","events_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/issues/1091/events","html_url":"https://github.com/california-civic-data-coalition/django-calaccess-raw-data/issues/1091","id":107846926,"number":1091,"title":"Add UNIQUE_KEY to the ``ReceivedFilingsCd`` database model","user":{"login":"palewire","id":9993,"avatar_url":"https://avatars.githubusercontent.com/u/9993?v=3","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/labels/documentation","name":"documentation","color":"eb6420"},{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/labels/small","name":"small","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/milestones/4","html_url":"https://github.com/california-civic-data-coalition/django-calaccess-raw-data/milestones/California%20Code%20Rush%203:%20ONA%2015","labels_url":"https://api.github.com/repos/california-civic-data-coalition/django-calaccess-raw-data/milestones/4/labels","id":1319702,"number":4,"title":"California Code Rush 3: ONA 15","description":"A third challenge for hacks, hackers and newbies of all ages at the 2015 Online News Association Conference in Los angeles.","creator":{"login":"palewire","id":9993,"avatar_url":"https://avatars.githubusercontent.com/u/9993?v=3","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"open_issues":69,"closed_issues":0,"state":"open","created_at":"2015-09-23T03:50:38Z","updated_at":"2015-09-23T04:18:23Z","due_on":"2015-09-29T07:00:00Z","closed_at":null},"comments":0,"created_at":"2015-09-23T04:18:23Z","updated_at":"2015-09-23T04:18:23Z","closed_at":null,"body":"\n## Your mission\n\nAdd a ``UNIQUE_KEY`` setting to the ``ReceivedFilingsCd`` database model.\n\n## Here's how\n\n**Step 1**: Claim this ticket by leaving a comment below. Tell everyone you're ON IT!\n\n**Step 2**: In a separate tab, open up the <a href=\"http://www.documentcloud.org/documents/1308002-cal-access-about.html#document/p100\">official state documentation</a> and find the page that defines this table. They are listed there in alphabetical order.\n\n![The docs](https://dl.dropboxusercontent.com/u/3640647/ScreenCloud/1440367001.08.png)\n\n**Step 3**: Find the \"PK_\" row in the index list included with the table's definition that spells out the list of \"column codes\" that make up the unique key for each row. If it lacks that documentation. Note that in the ticket and close it now.\n\n![The definition](https://dl.dropboxusercontent.com/u/3640647/ScreenCloud/1442811831.94.png)\n\n**Step 4**: Return to this tab.\n\n**Step 5**: Open up the file that contains this model. It should be in <a href=\"https://github.com/california-civic-data-coalition/django-calaccess-raw-data/blob/master/calaccess_raw/models/other.py\">calaccess_raw.models.other.py</a>.\n\n**Step 6**: Hit the little pencil button in the upper-right corner of the code box to begin editing the file.\n\n![Edit](https://dl.dropboxusercontent.com/u/3640647/ScreenCloud/1440367320.67.png)\n\n**Step 7**: Find this model in the file. (Clicking into the box and searching with CTRL-F can help you here.) Once you find it, we expect the model to lack a ``UNIQUE_KEY`` attribute indented just under the documentation.\n\n```python\nclass WhateverYourModel(CalAccessBaseModel):\n    '''\n    There will be some documentation here but don't touch it.\n    '''\n    field1 = models.CharField(blah='blah')\n```\n**Step 8**: Add this model's ``UNIQUE_KEY`` list of column codes, to our field definition by inserting it under the documentation. That should look something like this:\n\n```python\nclass WhateverYourModel(CalAccessBaseModel):\n    '''\n    There will be some documentation here but don't touch it.\n    '''\n    UNIQUE_KEY = ['FIELD1', 'FIELD2', 'FIELD3']\n    field1 = models.CharField(blah='blah')\n```\n\n**Step 9**: Scroll down below the code box and describe the change you've made in the commit message. Press the button below.\n\n**Step 10**:  Review your changes and create a pull request submitting them to the core team for inclusion.\n\nThat's it! Mission accomplished!\n"}}