Use Fanstatic to include resources:
from ajja import form form.need()
This will require all needed resources like jquery, knockout, handlebars, widgets and the code to setup and run ajja itself.
The documentation lives under http://ajja.readthedocs.org.
Please see the development package under https://github.com/gocept/ajja
gocept.jsformhas a new name:
ajja`s sources manually (which is not recommended), make sure to now include `form.jsinstead of
get_template(id)returns the compiled version of the template.
register_template(id, template, description)
list_templates()returns a list of templates with id and description
Serve handlebars templates precompiled in src/templates.js to complete bower integration. (#23)
Rename template source files. They are now accessible via
gocept.jsform.templates variable in the application. This is an backwards
Update version pinnings.
Depending on concrete pinnings for jquery(-ui) is not necessary as gocept.jsform supports jquery 1.x and 2.x. Also add explicit version pinnings for knockout and knockout-mapping as updating there by accident may break gocept.jsforms model behaviour.
form-controlCSS class to textarea template.
after-loadalways fires asynchonously.
bower-knockout-mappingin bower package instead of serving mapping plugin directly. (only effects bower package of
messagewas provided in the JSON response.
Improved handling of object and multiselect fields such that the values loaded are actually just the values, with select options being passed as the source field option. This is an important backwards-incompatible change.
Added a field option multiple that, when truthy and the selected type is object, makes the field be considered a list of objects. When using the default templates, this turns a select widget into multi-select.
When loading values into a form via the JS API rather than via HTTP as JSON, assume full objects, not tokens to be contained.
Add textarea template.
Added the concept of required fields which cannot be saved when blank.
More Bootstrap 3 compatibility.
Simplified HTML mark-up of form elements.
Removed the package metadata’s implicit dependency on the test extra.
Use classy classes.
Consider HTTP error responses unrecoverable errors. This distinguishes them from time-outs and connection errors.
Add loaded property on Form, a Deferred so clients can check whether loading has finished. This is mainly helpful for tests, e.g.:
selenium.waitForEval( '$("#jsform").data("form") && ' '$("#jsform").data("form").loaded.state()', '"resolved"')
Expose the get_template function for reuse outside the Form class.
If an empty string is specified as form_template, just use the existing form DOM node without applying any template.
Add jQuery plugin $().jsform_submit_button(callback) that sets up a button that saves the jsform and calls a function after the successful save.
csrf_token(can be customized) in the DOM.