我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wtforms.fields.TextField()。
def conv_String(self, field_args, **extra): self._string_common(field_args=field_args, **extra) return f.TextField(**field_args)
def conv_MSYear(self, field_args, **extra): field_args['validators'].append(validators.NumberRange(min=1901, max=2155)) return f.TextField(**field_args)
def conv_PGInet(self, field_args, **extra): field_args.setdefault('label', 'IP Address') field_args['validators'].append(validators.IPAddress()) return f.TextField(**field_args)
def conv_PGMacaddr(self, field_args, **extra): field_args.setdefault('label', 'MAC Address') field_args['validators'].append(validators.MacAddress()) return f.TextField(**field_args)
def conv_PGUuid(self, field_args, **extra): field_args.setdefault('label', 'UUID') field_args['validators'].append(validators.UUID()) return f.TextField(**field_args)
def conv_IPAddressField(self, model, field, kwargs): kwargs['validators'].append(validators.ip_address()) return f.TextField(**kwargs)
def conv_URLField(self, model, field, kwargs): kwargs['validators'].append(validators.url()) return f.TextField(**kwargs)
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)
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)
def conv_EmailField(self, model, field, kwargs): kwargs['validators'].append(validators.email()) return f.TextField(**kwargs)