-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError _etag #22
Comments
I had this issue until I changed some settings with the projection, at which point _etag existed. Collections without projection changes had this error, and those with projection changes didn't. Not sure what the underlying issue is but this fixes it. from models import Person, Address
from eve_mongoengine import EveMongoengine
ext = EveMongoengine(app)
# Register model
ext.add_model([Person, Address])
# Remove password hash and salt from projections, this collection was error free
app.config['SOURCES']['person']['projection'] = {'salt': 0, 'password': 0}
# This next line removed the error, but you need to set all the fields
app.config['SOURCES']['address']['projection'] = {'street': 1, 'zipcode': 1, 'city': 1, 'state': 1}
|
See also Eve issue #569. Qualifying the offending code to read:
gets past the problem, since the _etag is auto-generated if missing. |
@seglberg any update on this? |
I am getting this exception with a simple code. It breaks the
/person
endpoint and all of other endpoints I receive a 404 error.Using:
eve 0.5.3 or in-dev
eve-Mongoengine 0.0.9
class Person(mongoengine.Document):
name = mongoengine.StringField()
age = mongoengine.IntField()
app = Eve()
ext = EveMongoengine(app)
ext.add_model(Person)
The text was updated successfully, but these errors were encountered: