MongoEngine/mongoengine — pull request #445 by crazyzubr (2013-08-15 11:35:57+00:00)
Title: permit the establishment of a field with the name of size or other

Example:

# model
class Example(Document):
size = ReferenceField(Size, verbose_name='Size')

# query

examples = Example.objects(size=instance_size)

# caused an error

"""
File ".../mongoengine/queryset/transform.py", line 50, in query
if parts[-1] == 'not':
IndexError: list index out of range
"""