equal
deleted
inserted
replaced
201 if widget is None: |
201 if widget is None: |
202 if self.choices: |
202 if self.choices: |
203 widget = Select() |
203 widget = Select() |
204 elif self.max_length and self.max_length < 257: |
204 elif self.max_length and self.max_length < 257: |
205 widget = TextInput() |
205 widget = TextInput() |
206 widget.attrs.setdefault('size', min(45, self.max_length)) |
|
207 widget.attrs.setdefault('maxlength', self.max_length) |
|
208 |
206 |
209 super(StringField, self).init_widget(widget) |
207 super(StringField, self).init_widget(widget) |
210 if isinstance(self.widget, TextArea): |
208 if isinstance(self.widget, TextArea): |
211 self.init_text_area(self.widget) |
209 self.init_text_area(self.widget) |
212 |
210 |