Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)
Custom StringField that counts "" as None

src/f/l/flask-mongoengine-0.7.0/flask_mongoengine/wtf/orm.py   flask-mongoengine(Download)
from mongoengine import ReferenceField
 
from flask.ext.mongoengine.wtf.fields import ModelSelectField, ModelSelectMultipleField, DictField, NoneStringField, BinaryField
from flask.ext.mongoengine.wtf.models import ModelForm
 
    def conv_URL(self, model, field, kwargs):
        kwargs['validators'].append(validators.URL())
        self._string_common(model, field, kwargs)
        return NoneStringField(**kwargs)
 
    @converts('EmailField')
    def conv_Email(self, model, field, kwargs):
        kwargs['validators'].append(validators.Email())
        self._string_common(model, field, kwargs)
        return NoneStringField(**kwargs)

src/f/l/flask-mongoengine-HEAD/flask_mongoengine/wtf/orm.py   flask-mongoengine(Download)
from mongoengine import ReferenceField
 
from flask.ext.mongoengine.wtf.fields import ModelSelectField, ModelSelectMultipleField, DictField, NoneStringField, BinaryField
from flask.ext.mongoengine.wtf.models import ModelForm
 
    def conv_URL(self, model, field, kwargs):
        kwargs['validators'].append(validators.URL())
        self._string_common(model, field, kwargs)
        return NoneStringField(**kwargs)
 
    @converts('EmailField')
    def conv_Email(self, model, field, kwargs):
        kwargs['validators'].append(validators.Email())
        self._string_common(model, field, kwargs)
        return NoneStringField(**kwargs)