Started work on performance

Added an initial benchmark.py
Much more performant than 0.5.2 but still work todo.
This commit is contained in:
Ross Lawley
2011-12-16 12:41:42 +00:00
parent 7614b92197
commit 6d9bfff19c
5 changed files with 274 additions and 81 deletions

View File

@@ -11,7 +11,7 @@ import uuid
from base import (BaseField, ComplexBaseField, ObjectIdField,
ValidationError, get_document)
from queryset import DO_NOTHING
from queryset import DO_NOTHING, QuerySet
from document import Document, EmbeddedDocument
from connection import get_db, DEFAULT_CONNECTION_NAME
from operator import itemgetter
@@ -491,7 +491,7 @@ class ListField(ComplexBaseField):
def validate(self, value):
"""Make sure that a list of valid fields is being used.
"""
if (not isinstance(value, (list, tuple)) or
if (not isinstance(value, (list, tuple, QuerySet)) or
isinstance(value, basestring)):
self.error('Only lists and tuples may be used in a list field')
super(ListField, self).validate(value)