Skip to content

Commit

Permalink
Demos.
Browse files Browse the repository at this point in the history
  • Loading branch information
moschlar committed Aug 27, 2013
1 parent 94681e4 commit cacd0f4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tw2/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
CheckBox,
CheckBoxList,
CheckBoxTable,
ColorField,
EmailField,
FieldSet,
FileField,
FileValidator,
Expand All @@ -25,12 +27,15 @@
ListLayout,
MultipleSelectField,
MultipleSelectionField,
NumberField,
PasswordField,
RadioButton,
RadioButtonList,
RadioButtonTable,
RangeField,
ResetButton,
RowLayout,
SearchField,
SelectionField,
SeparatedCheckBoxTable,
SeparatedRadioButtonTable,
Expand All @@ -43,6 +48,7 @@
TableLayout,
TextField,
TextArea,
UrlField,
VerticalCheckBoxTable,
VerticalRadioButtonTable,
)
Expand Down
24 changes: 23 additions & 1 deletion tw2/forms/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class DemoTextField(twf.TextField):
placeholder = "Search upto 7 characters..."
placeholder = "Type up to 7 characters..."
maxlength = 7


Expand Down Expand Up @@ -121,3 +121,25 @@ def address(self):
]

fields = [DummyObject.name, DummyObject.address]


class DemoEmailField(twf.EmailField):
placeholder = 'Enter your Email-Address...'


class DemoUrlField(twf.UrlField):
placeholder = 'http://toscawidgets.org'


class DemoNumberField(twf.NumberField):
min = 0
max = 10
step = 2
value = 8


class DemoRangeField(twf.RangeField):
min = 0
max = 10
step = 2
value = 8
2 changes: 1 addition & 1 deletion tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class EmailField(TextField):
validator = twc.EmailValidator


class URLField(TextField):
class UrlField(TextField):
'''An url input field (HTML5 only).
Will fallback to a normal text input field on browser not supporting HTML5.
Expand Down

0 comments on commit cacd0f4

Please sign in to comment.