Skip to content

Development Archive

Jonny Buchanan edited this page Mar 6, 2015 · 6 revisions

0.10

  • ☑ Remove onStateChange
  • ☑ Fix for using this.addError() in clean() - now checks for duplicates.
  • How can we avoid clearing async validation messages unnecessarily?
    • ☑ Only validate if data has changed since the last validation was triggered.
  • Special cases for onBlur:
    • ☑ Trigger any pending validation.
    • ☑ Always validate if the field is required and empty.
  • ☑ New conditional CSS class Form properties: optionalCssClass & pendingCssClass
  • Async validation
    • API (allow fields to have custom but separate sync and async validation):
      • form.clean<Field>: function([cb]) { } - use existing method, callback optional
      • form.clean: function(cb) { } - use existing method, callback optional
      • formset.clean: function(cb) { } - use existing method, callback optional
      • Async versions of any top-level API which triggers the equivalent of full-form/onSubmit validation.
        • form.validate(cb)
    • ☑ Async onChange (hooked up automatically by newforms)
      • Custom field validation functions now get a callback if they have an arity of 1
    • Async onSubmit (user's responsibility to hook up)
      • ☑ Callback once all async validation completes
    • ☑ New form state for pending validations
      • ☑ These need to be cancellable for cases where multiple async validations are running simultaneously and some of their results need to be ignored
      • Can be used to display "working" status to the user and to delay final callback for full-form validation until al async validations are complete.
        • ☑ Add a method to BoundField to retrieve this status per-field
          • ☑ Use this to implement display of pending async field validation in default rendering methods.
          • ☑ Add pendingCssClass and generate it from BoundField
        • ☑ Add a method to BaseForm to retrieve pending status for all fields
          • ☑ A Form should never be isComplete() if still pending async validation
        • ☑ Add a method to BaseForm to retrieve this status for cross-field validation
          • ☑ Implement display of pending cross-field/whole-form validation in default rendering methods.
  • ☑ Create React components for default rendering
    • ☑ Deprecate asDiv/asTable/asUl

0.9

  • Changes to onChange & active validation
    • ☑ Rename onStateChange to onChange
      • ☑ Detect onStateChange, reassign to onChange and warn of deprecation in 0.9 dev version
    • ☑ Passing onChange now implies `validation: 'auto'
      • ☑ Check for both being passed and warn that it's not necessary in 0.9 dev version
    • ☑ Always hook up an onChange handler to widgets to keep form.data up to date with user input, even if it's not being validated
  • ☑ Use form.validate() as a means of forcing a full clean with the form's current data (always populated by onChange)
  • FormSet & FormSet-related changes
    • ☑ Add formset.validate([form])
    • ☑ Add formset.addError(error) for adding cross-form errors externally
    • ☑ Add formset.deleteForm(index)
    • ☑ Add form.notEmpty()
      • ☑ Cache the result of hasChanged() each time it's executed
      • Indicates that emptyPermitted no longer applies - use for highlighting required fields in extra forms in FormSets once the user has made a change.
    • ☑ Make addAnother() and deleteForm() call back to re-render when onChange() is available
  • ☑ Allow cross-form validation method to specify which fields it uses (to avoid calling it when possible)
    • API: clean: ['field1', 'field2', function() { ... }]

    • ☑ Detect this in DeclarativeFieldsMeta and transform to equivalent of:

      var clean = function() { ... }
      clean.fields = {'field1': true, 'field2': true}

0.8

  • Use React 0.12

0.7

  • ☑ Add a locales module for adding/getting locales and setting a default.
  • ☑ Change the formats module to use locales, adding a getFormat() function to get input/output formats by locale.

0.6

  • ☑ Add support for partial cleaning/validation
  • ☑ Add a controlled (default: false) option to Forms to enable use of controlled input components
    • ☑ Add a prefixed (default: false) option to setData() and updateData(), as the user shouldn't be forced to pass prefixed field names in order to programatically update controlled fields.
  • ☑ Add interactive onChange validation - whole form or per-field
    • ☑ Allow registration of multiple event handlers
    • 'auto' validation adds delayed onChange an instant onBlur validation to text fields, so the user also gets feedback when leaving a required field if they didn't change anything.
  • ☑ Add API for updating form.data without triggering validation, for controlled components
    • validate (default: true) and clearErrors (default: true) options to updateData()
    • validate (default: true) option to setData()
  • ☑ Get FormSets working with 0.6 features
    • ☑ Pass kwargs through to form.setData()
    • validate (default: true) option to setData()
  • ☑ Rename isBound to isInitialRender - more explicit about what it's actually used for.

0.5

  • ☑ Migrate from DOMBuilder to React
  • ☑ Generate React.DOM components
  • ☑ Manual validation, no changes needed to cleaning/validation process
  • ☑ Build data object from the DOM using formData()
  • ☑ Make FormSet API more suitable for the client side
Clone this wiki locally