{"action":"closed","issue":{"number":315,"created_at":"2011-10-12T19:44:45Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi!\r\n\r\nIt is probably not good practice, but trying to access \"pk\" on a EmbeddedDocument raises KeyError: 'id_field'.\r\n\r\nPerhaps this should be fixed.\r\n\r\nI run into this error when I tried to do ```[getattr(obj, fieldname) for fieldname in dir(obj) if not fieldname.startswith('_')]``` which might be a real use case. I fixed with a work around by adding ``` and fieldname not in ('pk', 'validate', 'to_mongo')``` to the condition.\r\n\r\nGot that error on mongoengine 0.4, not sure if that was fixed on 0.5 already.","comments":1,"title":"Accessing \"pk\" raises an error","updated_at":"2011-10-25T10:47:55Z","url":"https://api.github.com/repos/hmarr/mongoengine/issues/315","id":1891497,"assignee":null,"milestone":null,"closed_at":"2011-10-25T10:47:55Z","user":{"gravatar_id":"561b584a8d309e785ce6dc026d0cabeb","avatar_url":"https://secure.gravatar.com/avatar/561b584a8d309e785ce6dc026d0cabeb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jpfarias","id":1088009,"login":"jpfarias"},"html_url":"https://github.com/hmarr/mongoengine/issues/315","labels":[],"state":"closed"},"legacy":{"number":315,"action":"closed","issue":1891497}}