hmarr/mongoengine — pull request #519 by wpjunior (2012-06-19 14:08:08+00:00)
Title: Fixes for primary_key documents

test case:
```python
from mongoengine import *
from mongoengine import register_connection

register_connection('default', name='test')

class SettingValue(Document):
key = StringField(primary_key=True)
value = StringField()

s = SettingValue(key="test", value="test value")
s.save()

val = SettingValue.objects.scalar('key', 'value')
assert list(val) == [(u'test', u'test value')]
```

raises a error:
obj = getattr(obj, chunk)
AttributeError: 'SettingValue' object has no attribute '_id'