{"action":"created","issue":{"url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/137","repository_url":"https://api.github.com/repos/romgar/django-dirtyfields","labels_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/137/comments","events_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/137/events","html_url":"https://github.com/romgar/django-dirtyfields/issues/137","id":388201131,"node_id":"MDU6SXNzdWUzODgyMDExMzE=","number":137,"title":"get_dirty_fields after M2M.clear() problem","user":{"login":"korviinn","id":2090837,"node_id":"MDQ6VXNlcjIwOTA4Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/2090837?v=4","gravatar_id":"","url":"https://api.github.com/users/korviinn","html_url":"https://github.com/korviinn","followers_url":"https://api.github.com/users/korviinn/followers","following_url":"https://api.github.com/users/korviinn/following{/other_user}","gists_url":"https://api.github.com/users/korviinn/gists{/gist_id}","starred_url":"https://api.github.com/users/korviinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/korviinn/subscriptions","organizations_url":"https://api.github.com/users/korviinn/orgs","repos_url":"https://api.github.com/users/korviinn/repos","events_url":"https://api.github.com/users/korviinn/events{/privacy}","received_events_url":"https://api.github.com/users/korviinn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-06T12:53:45Z","updated_at":"2019-08-09T17:49:43Z","closed_at":"2019-08-09T17:49:43Z","author_association":"NONE","body":"Hi, \r\nI'm using django-dirtyfields==1.3.0\r\nAnd find such a problem:\r\nI've got a model - Order with two fields:\r\n- Vehicle - M2M field\r\n- start_datetime - Datetime field\r\n\r\nI try to update start_datetime and delete all vehicles in my Order.\r\nIn the result I need to print in logs of usual fields(no FK and M2M), with their new values\r\nIn my function I got such code:\r\n\r\n> order.pickup_datetime = pickup_datetime\r\n> logger.debug(order.is_dirty())\r\n> logger.debug(order.get_dirty_fields())\r\n> \r\n> order.vehicle.clear()\r\n> \r\n> logger.debug(order.is_dirty())\r\n> logger.debug(order.get_dirty_fields())\r\n> \r\n> order.save()\r\n\r\nWhen I look in my logs file I see the following thing:\r\n\r\nDEBUG\r\n\r\n>  True\r\n> DEBUG {'pickup_datetime': datetime.datetime(2018, 12, 7, 15, 5)}\r\n> DEBUG False\r\n> DEBUG {}\r\n\r\nAs you see before .clear() everything is ok, but then something goes wrong.\r\nAnd if I override order.save() method with self.get_dirty_fields() in it - I also got empty dict in the result.\r\n\r\nWhat am I doing wrong?\r\n"},"comment":{"url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/comments/520007225","html_url":"https://github.com/romgar/django-dirtyfields/issues/137#issuecomment-520007225","issue_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/137","id":520007225,"node_id":"MDEyOklzc3VlQ29tbWVudDUyMDAwNzIyNQ==","user":{"login":"romgar","id":2834704,"node_id":"MDQ6VXNlcjI4MzQ3MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2834704?v=4","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"created_at":"2019-08-09T17:49:43Z","updated_at":"2019-08-09T17:49:43Z","author_association":"OWNER","body":"Closing the issue for inactivity. Please feel free to open again if needed."}}
{"actor":{"display_login":"romgar"}}