{"action":"created","issue":{"url":"https://api.github.com/repos/applegrew/django-select2/issues/70","labels_url":"https://api.github.com/repos/applegrew/django-select2/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/applegrew/django-select2/issues/70/comments","events_url":"https://api.github.com/repos/applegrew/django-select2/issues/70/events","html_url":"https://github.com/applegrew/django-select2/pull/70","id":22023621,"number":70,"title":"Allow select2 fields to be chained using the filter_by widget option","user":{"login":"log0ymxm","id":35297,"avatar_url":"https://avatars.githubusercontent.com/u/35297?v=3","gravatar_id":"","url":"https://api.github.com/users/log0ymxm","html_url":"https://github.com/log0ymxm","followers_url":"https://api.github.com/users/log0ymxm/followers","following_url":"https://api.github.com/users/log0ymxm/following{/other_user}","gists_url":"https://api.github.com/users/log0ymxm/gists{/gist_id}","starred_url":"https://api.github.com/users/log0ymxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/log0ymxm/subscriptions","organizations_url":"https://api.github.com/users/log0ymxm/orgs","repos_url":"https://api.github.com/users/log0ymxm/repos","events_url":"https://api.github.com/users/log0ymxm/events{/privacy}","received_events_url":"https://api.github.com/users/log0ymxm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/applegrew/django-select2/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"codingjoe","id":1772890,"avatar_url":"https://avatars.githubusercontent.com/u/1772890?v=3","gravatar_id":"","url":"https://api.github.com/users/codingjoe","html_url":"https://github.com/codingjoe","followers_url":"https://api.github.com/users/codingjoe/followers","following_url":"https://api.github.com/users/codingjoe/following{/other_user}","gists_url":"https://api.github.com/users/codingjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/codingjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingjoe/subscriptions","organizations_url":"https://api.github.com/users/codingjoe/orgs","repos_url":"https://api.github.com/users/codingjoe/repos","events_url":"https://api.github.com/users/codingjoe/events{/privacy}","received_events_url":"https://api.github.com/users/codingjoe/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2013-11-03T17:54:34Z","updated_at":"2015-04-19T21:00:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/applegrew/django-select2/pulls/70","html_url":"https://github.com/applegrew/django-select2/pull/70","diff_url":"https://github.com/applegrew/django-select2/pull/70.diff","patch_url":"https://github.com/applegrew/django-select2/pull/70.patch"},"body":"This allows someone to chain multiple in-page select2 fields.\r\n\r\nIn my use case, I'm filtering state by country, and city by state as the user selects.\r\n\r\n    country = CountryChoices(\r\n        label='Country',\r\n        widget=AutoHeavySelect2Widget(\r\n            select2_options={\r\n                'placeholder': u\"Country\"\r\n            }\r\n        ))\r\n    state = StateChoices(\r\n        label='State',\r\n        widget=AutoHeavySelect2Widget(\r\n            filter_by={\r\n                'id': 'id_country',\r\n                'related_name': 'country'\r\n            },\r\n            select2_options={\r\n                'placeholder': u\"State\"\r\n            }\r\n        ))\r\n    city = CityChoices(\r\n        label='City',\r\n        widget=AutoHeavySelect2Widget(\r\n            filter_by={\r\n                'id': 'id_state',\r\n                'related_name': 'region'\r\n            },\r\n            select2_options={\r\n                'placeholder': u\"City\"\r\n            }\r\n        ))\r\n\r\nLet me know if there is a cleaner way to integrate this option. Referencing the id seems like it could be improved. Maybe there's a better place to put these, rather than the widget."},"comment":{"url":"https://api.github.com/repos/applegrew/django-select2/issues/comments/94313373","html_url":"https://github.com/applegrew/django-select2/pull/70#issuecomment-94313373","issue_url":"https://api.github.com/repos/applegrew/django-select2/issues/70","id":94313373,"user":{"login":"adelsonllima","id":2631340,"avatar_url":"https://avatars.githubusercontent.com/u/2631340?v=3","gravatar_id":"","url":"https://api.github.com/users/adelsonllima","html_url":"https://github.com/adelsonllima","followers_url":"https://api.github.com/users/adelsonllima/followers","following_url":"https://api.github.com/users/adelsonllima/following{/other_user}","gists_url":"https://api.github.com/users/adelsonllima/gists{/gist_id}","starred_url":"https://api.github.com/users/adelsonllima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelsonllima/subscriptions","organizations_url":"https://api.github.com/users/adelsonllima/orgs","repos_url":"https://api.github.com/users/adelsonllima/repos","events_url":"https://api.github.com/users/adelsonllima/events{/privacy}","received_events_url":"https://api.github.com/users/adelsonllima/received_events","type":"User","site_admin":false},"created_at":"2015-04-19T21:00:01Z","updated_at":"2015-04-19T21:00:01Z","body":"????"}}