Python wtforms.validators.length() Examples

The following are 15 code examples of wtforms.validators.length(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wtforms.validators , or try the search function .
Example #1
Source File: ndb.py    From jbox with MIT License 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``ndb.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #2
Source File: ndb.py    From jbox with MIT License 5 votes vote down vote up
def convert_StringProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.StringProperty``."""
        if prop._repeated:
            return StringListPropertyField(**kwargs)
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #3
Source File: ndb.py    From jbox with MIT License 5 votes vote down vote up
def convert_GenericProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ListProperty``."""
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #4
Source File: db.py    From jbox with MIT License 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``db.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #5
Source File: db.py    From jbox with MIT License 5 votes vote down vote up
def convert_StringProperty(model, prop, kwargs):
    """Returns a form field for a ``db.StringProperty``."""
    if prop.multiline:
        kwargs['validators'].append(validators.length(max=500))
        return f.TextAreaField(**kwargs)
    else:
        return get_TextField(kwargs) 
Example #6
Source File: ndb.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``ndb.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #7
Source File: ndb.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def convert_StringProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.StringProperty``."""
        if prop._repeated:
            return StringListPropertyField(**kwargs)
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #8
Source File: ndb.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def convert_GenericProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ListProperty``."""
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #9
Source File: db.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``db.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #10
Source File: db.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def convert_StringProperty(model, prop, kwargs):
    """Returns a form field for a ``db.StringProperty``."""
    if prop.multiline:
        kwargs['validators'].append(validators.length(max=500))
        return f.TextAreaField(**kwargs)
    else:
        return get_TextField(kwargs) 
Example #11
Source File: ndb.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``ndb.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #12
Source File: ndb.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def convert_StringProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.StringProperty``."""
        if prop._repeated:
            return StringListPropertyField(**kwargs)
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #13
Source File: ndb.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def convert_GenericProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ListProperty``."""
        kwargs['validators'].append(validators.length(max=500))
        return get_TextField(kwargs) 
Example #14
Source File: db.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def get_TextField(kwargs):
    """
    Returns a ``TextField``, applying the ``db.StringProperty`` length limit
    of 500 bytes.
    """
    kwargs['validators'].append(validators.length(max=500))
    return f.TextField(**kwargs) 
Example #15
Source File: db.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def convert_StringProperty(model, prop, kwargs):
    """Returns a form field for a ``db.StringProperty``."""
    if prop.multiline:
        kwargs['validators'].append(validators.length(max=500))
        return f.TextAreaField(**kwargs)
    else:
        return get_TextField(kwargs)