@@ -68,9 +68,11 @@ def convert(self, model, field, field_args):
6868
6969 if ftype in self .converters :
7070 kwargs ["coerce" ] = self .coerce (ftype )
71- if kwargs .pop ('multiple' , False ):
71+ multiple_field = kwargs .pop ('multiple' , False )
72+ radio_field = kwargs .pop ('radio' , False )
73+ if multiple_field :
7274 return f .SelectMultipleField (** kwargs )
73- if kwargs . pop ( 'radio' , False ) :
75+ if radio_field :
7476 return f .RadioField (** kwargs )
7577 return f .SelectField (** kwargs )
7678
@@ -101,9 +103,11 @@ def conv_String(self, model, field, kwargs):
101103 if field .regex :
102104 kwargs ['validators' ].append (validators .Regexp (regex = field .regex ))
103105 self ._string_common (model , field , kwargs )
104- if kwargs .pop ('password' , False ):
106+ password_field = kwargs .pop ('password' , False )
107+ textarea_field = kwargs .pop ('textarea' , False ) or not field .max_length
108+ if password_field :
105109 return f .PasswordField (** kwargs )
106- if kwargs . pop ( 'textarea' , False ) or not field . max_length :
110+ if textarea_field :
107111 return f .TextAreaField (** kwargs )
108112 return f .StringField (** kwargs )
109113
0 commit comments