github django html5,django-html5-forms

Author: Adam Cupiał

Contributors: Andrei Antoukh, Ben Lopatin, Marcin Kozioł, Berry Philips, Sebastian Vetter

Description

Formfields in django are not suited for HTML5, hence this app

Installation

clone repository git clone git://github.com/adamcupial/django-html5-forms.git, put it somewhere in your python path

add 'html5forms' to INSTALLED_APPS (not required)

use appropriate form fields in your forms (since the widgets requires some additional attributes passed from forms, you should use fields)

Fields

All fields

Attributes

all the core attributes from django field

placeholder :text, which displays on the field when it is empty and unfocused

autofocus (true/false), automaticaly set focus to element on page load

Html5CharField

widget: Html5TextInput

Typical CharField, most common field in the internet, allows datalist choices, which is great autocomplete feature

all the attr of django CharField

datalist: list or tuple, of words for autocompletion (sng like autocomplete in firefox or chrome)

Html5PasswordField

widget: Html5PasswordInput

Typical PasswordField, does not allow datalist choices

all the attr of django CharField/PasswordField

Html5SearchField

widget: Html5SearchInput

New field in HTML5 - the same as CharField only different input type, should be used in search fields, allows datalists

all the attr of django CharField/PasswordField

Html5EmailField

widget: Html5EmailInput

Html5UrlField

Html5IntegerField

widget: Html5NumberInput

Attributes:

required = [True/False]

min_value

max_value

Html5BooleanField

widget: Html5CheckboxInput

Html5RangeField

widget: Html5RangeInput

Attributes:

same as Html5IntegerField

step

Html5ChoiceField

widget: Html5Select

Attributes:

same as forms.ChoiceField

Html5TelField

widget: Html5TelInput

New field in HTML5 - provides defaults for minimum and maximum length that

should accept most phone numbers.

Attributes:

same as Html5CharField

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值