{"action":"created","issue":{"url":"https://api.github.com/repos/django/django/issues/7678","repository_url":"https://api.github.com/repos/django/django","labels_url":"https://api.github.com/repos/django/django/issues/7678/labels{/name}","comments_url":"https://api.github.com/repos/django/django/issues/7678/comments","events_url":"https://api.github.com/repos/django/django/issues/7678/events","html_url":"https://github.com/django/django/pull/7678","id":194807522,"number":7678,"title":"Fixed #27589 -- Added managed triggers for SearchVectorField.","user":{"login":"eukreign","id":69960,"avatar_url":"https://avatars.githubusercontent.com/u/69960?v=3","gravatar_id":"","url":"https://api.github.com/users/eukreign","html_url":"https://github.com/eukreign","followers_url":"https://api.github.com/users/eukreign/followers","following_url":"https://api.github.com/users/eukreign/following{/other_user}","gists_url":"https://api.github.com/users/eukreign/gists{/gist_id}","starred_url":"https://api.github.com/users/eukreign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eukreign/subscriptions","organizations_url":"https://api.github.com/users/eukreign/orgs","repos_url":"https://api.github.com/users/eukreign/repos","events_url":"https://api.github.com/users/eukreign/events{/privacy}","received_events_url":"https://api.github.com/users/eukreign/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-11T02:14:52Z","updated_at":"2016-12-12T16:42:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/7678","html_url":"https://github.com/django/django/pull/7678","diff_url":"https://github.com/django/django/pull/7678.diff","patch_url":"https://github.com/django/django/pull/7678.patch"},"body":"This is a significantly enhanced version of `django.contrib.postgresql.search.SearchVectorField` with automatically generated and managed database trigger.\r\n\r\nRemaining todo's:\r\n\r\n- [ ] documentation\r\n- [x] only update the `tsvector` column if the fields on which it depends have changed (need to add a conditional in the pl/pgsql function check if relevant columns have changed)\r\n- [x] instead of hard coding language in the field definition, also support column name\r\n\r\nThere are probably a lot of other things that will need to be done. Please provide feedback, thanks!\r\n\r\nhttps://code.djangoproject.com/ticket/27589"},"comment":{"url":"https://api.github.com/repos/django/django/issues/comments/266481419","html_url":"https://github.com/django/django/pull/7678#issuecomment-266481419","issue_url":"https://api.github.com/repos/django/django/issues/7678","id":266481419,"user":{"login":"eukreign","id":69960,"avatar_url":"https://avatars.githubusercontent.com/u/69960?v=3","gravatar_id":"","url":"https://api.github.com/users/eukreign","html_url":"https://github.com/eukreign","followers_url":"https://api.github.com/users/eukreign/followers","following_url":"https://api.github.com/users/eukreign/following{/other_user}","gists_url":"https://api.github.com/users/eukreign/gists{/gist_id}","starred_url":"https://api.github.com/users/eukreign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eukreign/subscriptions","organizations_url":"https://api.github.com/users/eukreign/orgs","repos_url":"https://api.github.com/users/eukreign/repos","events_url":"https://api.github.com/users/eukreign/events{/privacy}","received_events_url":"https://api.github.com/users/eukreign/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T16:42:35Z","updated_at":"2016-12-12T16:42:35Z","body":"The primary reason I added this is so that the `SearchVectorField()` could be more of a black box. You add it to your model, make/run migrations and \"it just works\".\r\n\r\nOn the other hand, I can't think of anything a database trigger solves that is otherwise impossible to do with a `pre_save` signal in Python. Although, I think most `pre_save` scenarios would require at least one extra query to perform whatever action you want.\r\n\r\nIn cases where you want to cut down on the number of queries or how much data you are sending to postgres then stored procedures become very useful.\r\n\r\nI'm open to doing a more general purpose stored procedure building system. But I don't think that should be a blocker for this feature. The fact that the underlying code for the new `SearchVectorField` is very specialized is an implementation detail. Once a general purpose procedure framework exists we could replace the current specialized version and the `SearchVectorField` wouldn't know the difference."}}
{"actor":{"display_login":"eukreign"}}