dont use var name "input"

This commit is contained in:
Andrew Croce 2018-07-25 13:28:48 -04:00
parent c98cdb2352
commit 8ba4c372f4
3 changed files with 12 additions and 12 deletions

View File

@ -12,23 +12,23 @@ class Alert(UIModule):
level=level) level=level)
class TextInput(UIModule): class TextInput(UIModule):
def render(self, input, placeholder=''): def render(self, field, placeholder=''):
return self.render_string( return self.render_string(
"components/text_input.html.to", "components/text_input.html.to",
input=input, field=field,
label=re.sub('<[^<]+?>', '', str(input.label)), label=re.sub('<[^<]+?>', '', str(field.label)),
errors=input.errors, errors=field.errors,
placeholder=placeholder, placeholder=placeholder,
description=input.description) description=field.description)
class OptionsInput(UIModule): class OptionsInput(UIModule):
def render(self, input, inline=False): def render(self, field, inline=False):
return self.render_string( return self.render_string(
"components/options_input.html.to", "components/options_input.html.to",
input=input, field=field,
label=re.sub('<[^<]+?>', '', str(input.label)), label=re.sub('<[^<]+?>', '', str(field.label)),
errors=input.errors, errors=field.errors,
description=input.description, description=field.description,
inline=inline) inline=inline)
class Icon(UIModule): class Icon(UIModule):

View File

@ -12,7 +12,7 @@
{% end %} {% end %}
</legend> </legend>
{% raw input() %} {% raw field() %}
{% if errors %} {% if errors %}
{% for error in errors %} {% for error in errors %}

View File

@ -11,7 +11,7 @@
{% end %} {% end %}
</label> </label>
{% raw input(placeholder=placeholder) %} {% raw field(placeholder=placeholder) %}
{% if errors %} {% if errors %}
{% for error in errors %} {% for error in errors %}