All Versions
24
Latest Version
Avg Release Cycle
59 days
Latest Release
3097 days ago

Changelog History
Page 2

  • v0.8.0 Changes

    October 29, 2014
    • โšก๏ธ Updated to React 0.12 - using new React.createElement() and React.createFactory() API for ReactElement creation.
  • 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 to form.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 a prefixed option argument which controls this and a new setFormData() method which replicates the old behaviour. This makes setData() 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 of form.data, so you can change what's displayed in the form by updating its data.
    • โž• Added calling of aonStateChange() 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 using validation or controlled 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 to form.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-form onSubmit 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 using BoundField#cssClasses() directly, if present on a form or its prototype.
    • โž• Added a top-level validateAll utility method equivalent to form.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.
  • 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 new formset.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 from DOMBuilder.createElement().
    • Components which can be rendered no longer have toString() methods -- creation of final output is now handled by calling React.renderComponent or React.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 provided checkTest 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 - a messages() method must now be called to get final error message strings out of it.

    • Replaced asP() with asDiv(), as invalid markup nesting breaks React when browsers perform error correction on the DOM.

    • ๐Ÿ“‡ Renamed Field.extraCLasses option to Field.cssClass.

    • ๐Ÿ“‡ Renamed asUL() methods to asUl().

    • 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> or clean_<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 for EmailField
      • Added URLInput - now the default widget for URLField
      • Added NumberInput - now the default widget for IntegerField, FloatField and DecimalField
      • IntegerField, FloatField and DecimalField now set HTML5 max, min and steo attributes on their widget, as applicable.
    • ๐Ÿ‘ 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 to RadioSelect -- 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 and URLField now support whitespace stripping.

    • ๐Ÿ”„ Changed data checking now supports calling initial values which are functions.

    • โž• Added minNum, validateMax and validateMin to formsetFactory and BaseFormSet.

    • โž• 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 sets needsMultipartForm based on its child widgets.

    • โž• Added requireAllfields option to MultiValueField - this allows for optional subfields when false 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 from cleanedData,

    • cleanedData doesn't need to be returned from Form.clean() any more, but if it is, it will still be set as form.cleanedData.

    • Made emptyValues a property of Field.prototype so it can be overridden by subclasses if necessary.

    • TypedChoiceField#coerce can now return an arbitrary value.

    • labelSuffix can now be customised when calling BoundField#labelTag.

    • validators is now exposed as forms.validators.

    • โž• Added Field#isEmptyValue and Field#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() and toJSON() to ErrorObject and ErrorList.

    • Custom clean<FieldName>() methods no longer have to return a cleaned value, but if they do, it will be inserted back into cleanedData.

    • ClearableFileInput now uses overridable functions for templating, making it easier to customise.

    • FileField now validates that a file is selected when required is true 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 an accept="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 by CheckboxInput.
    • CheckboxInput._hasChanged now handles an initial 'false' String.
    • FloatField and DecimalField 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 passing id or autoId 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 under forms.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's labelSuffix