Changelog History
Page 2
-
v0.8.0 Changes
October 29, 2014- โก๏ธ Updated to React 0.12 - using new
React.createElement()
andReact.createFactory()
API forReactElement
creation.
- โก๏ธ Updated to React 0.12 - using new
-
v0.7.0 Changes
July 27, 2014- โก๏ธ Updated to React 0.11 - there are no library dependencies on new 0.11 features, but unit tests depend on improvements made to its static HTML generation.
๐ New Features
- โ Added locale support.
-
v0.6.0 Changes
May 07, 2014๐ฅ Breaking Changes
- ๐ Renamed
form.isBound
toform.isInitialRender
, which more accurately reflects usage of this property (it was always being used in Forms as!isBound
) - ๐ Changed
form.setData()
to no longer accept prefixed data by default. Added aprefixed
option argument which controls this and a newsetFormData()
method which replicates the old behaviour. This makessetData()
more user-friendly for use with controlled forms.
๐ New Features
- โ Added per-field validation as the user makes changes to the form, configured
by passing a
validation
option when constructing a Form, Field or FormSet. - โ Added toggling of creation of controlled React components, configured by
passing a
controlled
option when constructing a Form or FormSet. When using controlled components, form widgets reflect the state ofform.data
, so you can change what's displayed in the form by updating its data. - โ Added calling of a
onStateChange()
callback when provided - passed as an option when constructing a Form or FormSet - any time validation state may have changed as a result of updating user input from controlled components, or as a result of validation triggered by user interaction. This option becomes required when usingvalidation
orcontrolled
options. - โ Added support for partial updating (
form.updateData(partialData)
) and cleaning (form.partialClean(fieldNames)
) of data. - โ Added
form.reset(newInitial)
to reset a form back to its initial state, optionally providing new initial data in the process. - โ Added a
validate
option toform.setData()
to support setting incomplete data in a controlled form without triggering required field validation errors. - โ Added
form.validate(<form>)
as a convenience method for retrieving and validating input data from a<form>
- this removes a common step when hooking up full-formonSubmit
validation. - โ Added
form.isComplete()
to determine if all required fields have valid input data when validation is being performed interactively. - โ Added
.errorMessage()
and.errorMessages()
to BoundField as a convenience for accessing error message strings, instead of having to go through.errors()
and use the ErrorList API. - โ Added generation of a
validCssClass
in default rendering or when usingBoundField#cssClasses()
directly, if present on a form or its prototype. - โ Added a top-level
validateAll
utility method equivalent toform.validate()
but for multiple Forms and/or FormSets. - โ Added
Widget.prototype.needsInitialValue
to allow Widgets to always receive the initial value of a field in addition to user input to be rendered.
๐ Changes
- ๐ Changed default widget attributes to always have a
key
property, to prevent fields being recreated when content around them changes (e.g. new validation errors being displayed), which makes them lose focus. - Form and FormSet
cleanedData
is now always defined regardless of whether or not any validation has been performed yet - this makes it safe to check for data at any time, particularly in cross-field validation. - โก๏ธ Updated to React 0.10 - there are no library dependencies on new 0.10 features, but unit tests now make use of its enhanced support for rendering to static HTML.
๐ Bug Fixes
- FormSet sub-forms are no longer created from scratch every time they're accessed when running in the browser - this was throwing away form state, which effectively broke FormSets.
- ๐ Renamed
-
v0.5.2 Changes
April 03, 2014- ๐ Fixed Select widget's defaultValue attribute.
-
v0.5.1 Changes
April 01, 2014- ๐ Fixed browserification when used as a Node module.
-
v0.5.0 Changes
March 11, 2014๐ Changes in addition to 0.5.0-rc1:
- Made hidden fields controlled components which always reflect form state on each render, since there's no way for the user to interact with them.
Made FormSets more usable on the client-side:
- Form instances aren't cached, so adding and removing forms by tweaking form count variables works without having to recreate the formset, or touching undocumented state.
- ManagementForm isn't used for formset configuration details when the formset is bound - as a result, you don't have to render its hidden fields for browser-only usage.
- If rendered, the ManagementForm always reflects FormSet state, not bound
data, so doing things like bumping
formset.extra
to show another form works regardless of whether or not the formset is bound. - Added a
setData()
method to bind newformset.data
and re-trigger validation.
-
v0.5.0-rc1 Changes
March 08, 2014๐ฅ Breaking Changes
- Now depends on React 0.9.0.
- ๐ Newforms components now render by creating
React.DOM
components instead of relying on context-specific output fromDOMBuilder.createElement()
. - Components which can be rendered no longer have
toString()
methods -- creation of final output is now handled by callingReact.renderComponent
orReact.renderComponentToString
on a React component which includes rendered output of a newforms Form - this (temporarily) breaks usage of newforms in String-based templating libraries such as Jade. โ HTML output has changed - this will break any tests which depended on the specifics of how DOMBuilder generated HTML.
- React has no equivalent of a virtual DocumentFragment as yet - there are new wrapper elements in various places.
- React wraps free-standing text nodes with
<span>
. - Boolean attributes no longer have a value duplicating the attribute name.
HTML attribute names must now match what React expects - no more
'maxlength'
or quoted'class'
and'for'
attributes.A String can no longer be used to specify multiple selected items in a
SelectMultiple
- this used to be an accident based on duck typing of index access to both items in an Array and characters in a String. If a non-Array is given as the selected value, it will now be wtapped in an Array.CheckboxInput
no longer silenty swallows any errors thrown by the providedcheckTest
function.๐
_hasChanged
has moved from Widgets to Fields.0๏ธโฃ The default error message for an invalid email address has changed.
ValidationError
API changed -messages
is now a function rather than an array of Strings.ErrorList
API changed - amessages()
method must now be called to get final error message strings out of it.Replaced
asP()
withasDiv()
, as invalid markup nesting breaks React when browsers perform error correction on the DOM.๐ Renamed
Field.extraCLasses
option toField.cssClass
.๐ Renamed
asUL()
methods toasUl()
.Order of mixing in fields from when multiple Forms are passed to
__mixin__
has changed from right-to-left to left-to-right.Only one custom field cleaning functon will be called:
clean<FieldName>
orclean_<fieldName>
in that order. The ability to define both and have both run was unintentional.
๐ New Features
A
type
attribute can now be passed to Widgets to take advantage of new HTML widget types.- Added
EmailInput
- now the default widget forEmailField
- Added
URLInput
- now the default widget forURLField
- Added
NumberInput
- now the default widget forIntegerField
,FloatField
andDecimalField
IntegerField
,FloatField
andDecimalField
now set HTML5max
,min
andsteo
attributes on their widget, as applicable.
- Added
๐
formData
now supports new input types: 'email', 'url', 'number' and 'file'If a field throws a
ValidationError
while checking if it's changed, the assumption is now that it's changed.cleanedData
is no longer deleted when a form is invalid.CheckboxSelectMultiple
now uses a similar renderer toRadioSelect
-- individual checkbox subwidgets can now be accessed.id
attributes are now added to lists of radio and checkbox inputs.Radio and checkbox input lists can now display with nested choices
๐
SlugField
andURLField
now support whitespace stripping.๐ Changed data checking now supports calling initial values which are functions.
โ Added
minNum
,validateMax
andvalidateMin
toformsetFactory
andBaseFormSet
.โ Added a hard limit to the maximum number of forms in a
FormSet
-maxNum
- 1000.
FormSet deletion management data is no longer removd from
cleanedData
.MultiWidget
now setsneedsMultipartForm
based on its child widgets.โ Added
requireAllfields
option toMultiValueField
- this allows for optional subfields whenfalse
and a new'incomplete'
validation error being thrown when required field are empty.โ Added an
addError()
method to forms which can be used to set field or non-field errors and automatically removes fields fromcleanedData
,cleanedData
doesn't need to be returned fromForm.clean()
any more, but if it is, it will still be set asform.cleanedData
.Made
emptyValues
a property ofField.prototype
so it can be overridden by subclasses if necessary.TypedChoiceField#coerce
can now return an arbitrary value.labelSuffix
can now be customised when callingBoundField#labelTag
.validators is now exposed as
forms.validators
.โ Added
Field#isEmptyValue
andField#emptyValueArray
to ensure empty arrays are detected as empty values by default.โ Added the ability to avoid inheriting a field from an extended or mixed-in Form by shadowing its field name with a non-field property.
โ Added
asData()
andtoJSON()
toErrorObject
andErrorList
.Custom
clean<FieldName>()
methods no longer have to return a cleaned value, but if they do, it will be inserted back intocleanedData
.ClearableFileInput
now uses overridable functions for templating, making it easier to customise.FileField
now validates that a file is selected whenrequired
istrue
in browsers.0๏ธโฃ Default rendering methods now allow arbitrary HTML in
helpText
if{__html: ''}
is passed instead of a string.โ Added
form.setData()
to bind new data to a form and re-trigger cleaning.โ Added a
custom
argument when constructing Fields, to store any metadata you need for later.ImageField
now adds anaccept="image/*"
attribute to its widget.โ Added
form.util.makeChoices
helper for creating [value, label] pairs from a list of objects.Flat lists of
choices
can now be passed into Fields and Widgets which take choices.
๐ Bug Fixes
'0'
should be treated as true byCheckboxInput
.CheckboxInput._hasChanged
now handles an initial'false'
String.FloatField
andDecimalField
now accept '1.' as a valid input.- Fixed form constructors used as mixin mixins having their own
baseFields
overwritten and the prototype properties intended for the new form applied to them. - ๐ Fixed
Boundfield#subWidgets
not passingid
orautoId
along, so label htmlFors and input ids weren't getting generated.
-
v0.4.2 Changes
July 15, 2012- Automatically-added deletion fields are no longer included in the list of cleanedData for a FormSet [whardeman]
- Data for forms marked for deletion is no longer present in a FormSet's cleanedData [whardeman]
- ๐ Fixed
FloatField.prototype._hasChanged()
, which wasn't comparing against the field's initial value - โ Added
managementFormCssClass
to BaseFormSet's kwargs, to provide a CSS class for the row generated to hold the management form's hidden fields - โ Added use of
hiddenFieldRowCssClass
to provide a CSS class for Form rows which were generated solely to wrap empty fields to avoid generating invalid HTML - โ Added use of
rowCssClass
to provide a class for each row in a Form [whardeman]
-
v0.4.1 Changes
June 29, 2012- โก๏ธ Updated to isomorph 0.2
- โ Added
extraClasses
to Field's kwargs [whardeman]
-
v0.4.0 Changes
March 08, 2012- Extracted validators into a validators
project and added it as a dependency - as a result,
callValidator()
,isCallable()
and IPv6 functions now live underforms.validators
- Extracted URL utility functions out into isomorph
- ๐ Fixed #11: a validator's error message should take precedence unless the field it's validating has defined a custom error message using the same error code
- ๐ Changed
BoundField.protoype.labelTag()
to also include the form'slabelSuffix
- Extracted validators into a validators
project and added it as a dependency - as a result,