{"action":"opened","issue":{"url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/237","repository_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils","labels_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/237/comments","events_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/237/events","html_url":"https://github.com/kvesteri/sqlalchemy-utils/issues/237","id":167872442,"number":237,"title":"generic_relationship do not set dirty fields when updating","user":{"login":"Keeper82","id":399919,"avatar_url":"https://avatars.githubusercontent.com/u/399919?v=3","gravatar_id":"","url":"https://api.github.com/users/Keeper82","html_url":"https://github.com/Keeper82","followers_url":"https://api.github.com/users/Keeper82/followers","following_url":"https://api.github.com/users/Keeper82/following{/other_user}","gists_url":"https://api.github.com/users/Keeper82/gists{/gist_id}","starred_url":"https://api.github.com/users/Keeper82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keeper82/subscriptions","organizations_url":"https://api.github.com/users/Keeper82/orgs","repos_url":"https://api.github.com/users/Keeper82/repos","events_url":"https://api.github.com/users/Keeper82/events{/privacy}","received_events_url":"https://api.github.com/users/Keeper82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-27T14:45:32Z","updated_at":"2016-07-27T14:45:32Z","closed_at":null,"body":"Changing a generic_relationship and then committing the session, the relative columns are not marked as dirty so the update isn't executed.\r\n\r\nFor example: (using the same objects as the documentation)\r\n\r\n```python\r\nother_user = session.query(User).get(2)\r\nevent = session.query(Event).get(1)\r\nevent.object = other_user\r\nsession.commit()\r\n```\r\n\r\nI tried modifying the attributes `object_id` and `object_name` before setting `object` and it works.\r\nI also tried manually setting the dirty flag using `from sqlalchemy.orm.attributes import flag_modified` and it also works."}}
{"actor":{"display_login":"Keeper82"}}