mongoengine
mongoengine copied to clipboard
param null=True is no working ?
Example
use a URLField like this :
class Test(Document):
test = URLField(null=True)
Test.objects.create(test='')
will get a error:
mongoengine.errors.ValidationError: ValidationError (Test:None) (Invalid scheme in URL: : ['test'])
Using null=True
will save null
in the database if no value (None
) was given.
To allow empty strings override the URL-Regex (see docs).