{"action":"closed","issue":{"url":"https://api.github.com/repos/firstopinion/prom/issues/16","labels_url":"https://api.github.com/repos/firstopinion/prom/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/firstopinion/prom/issues/16/comments","events_url":"https://api.github.com/repos/firstopinion/prom/issues/16/events","html_url":"https://github.com/firstopinion/prom/issues/16","id":120493318,"number":16,"title":"Expand Field with dbset and dbget methods","user":{"login":"Jaymon","id":125117,"avatar_url":"https://avatars.githubusercontent.com/u/125117?v=3","gravatar_id":"","url":"https://api.github.com/users/Jaymon","html_url":"https://github.com/Jaymon","followers_url":"https://api.github.com/users/Jaymon/followers","following_url":"https://api.github.com/users/Jaymon/following{/other_user}","gists_url":"https://api.github.com/users/Jaymon/gists{/gist_id}","starred_url":"https://api.github.com/users/Jaymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jaymon/subscriptions","organizations_url":"https://api.github.com/users/Jaymon/orgs","repos_url":"https://api.github.com/users/Jaymon/repos","events_url":"https://api.github.com/users/Jaymon/events{/privacy}","received_events_url":"https://api.github.com/users/Jaymon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/firstopinion/prom/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-04T21:48:40Z","updated_at":"2016-01-09T09:07:08Z","closed_at":"2016-01-09T09:07:08Z","body":"They should act similar to `fget` and `fset` methods but be fired when the field is about to be written to the db and read from the db.\r\n\r\nthe dbset method:\r\n\r\n```python\r\ndef dbset(val, is_update=False, is_modified=False)\r\n    \"\"\"\r\n    run this method right before the field is to be passed to the db to be written\r\n\r\n    val -- mixed -- the current value the field contains\r\n    is_update -- boolean -- True if updating, False if inserting\r\n    is_modified -- boolean -- True if the field has been modified since last pull from db\r\n    \"\"\"\r\n    return val\r\n```\r\n\r\nThe dbget method:\r\n\r\n```python\r\ndef dbget(val):\r\n    \"\"\"val has just been pulled from the db, the returned val will be put into the field\"\"\"\r\n    return val\r\n```"}}