Merge branch 'master' of git://github.com/flosch/mongoengine into v0.4

Conflicts:
	tests/fields.py
This commit is contained in:
Harry Marr
2010-08-30 13:21:10 +01:00
6 changed files with 27 additions and 7 deletions

View File

@@ -66,6 +66,9 @@ class StringField(BaseField):
regex = r'%s$'
elif op == 'exact':
regex = r'^%s$'
# escape unsafe characters which could lead to a re.error
value = re.escape(value)
value = re.compile(regex % value, flags)
return value