Skip to main content

Utilities for https://github.com/anutron/behavior integration with django.

Project description

Utilities for https://github.com/anutron/behavior integration with django.

This app provides template filters that can alter data attributes of the form fields required for behavior. It also have a ‘behavior’ and ‘behavior-more’ libraries bundled for use with django.contrib.staticfiles.

The license is MIT.

Installation

pip install django-mootools-behavior

Configuration

  1. Add ‘mootools_behavior’ to INSTALLED_APPS;

  2. (optional) run python manage.py collectstatic in order to get ‘behavior’ javascript files;

  3. include the necessary js into html and use provided template filters in order to set attributes for form elements.

Filters

behave

Sets ‘data-behavior-…’ attribute to a form field:

{% load mootools_behavior %}

<!-- data-behavior:"OverText" will be added to input field -->
{{ form.title|behave:"OverText" }}

set_data

Sets HTML5 data attribute ( http://ejohn.org/blog/html-5-data-attributes/ ).

Example:

{% load mootools_behavior %}

<!-- data-behavior:"OverText" will be added to input field -->
{{ form.title|set_data:"behavior:OverText" }}

Contributing

If you’ve found a bug, implemented a feature or have a suggestion, do not hesitate to contact me, fire an issue or send a pull request.

Source code:

Report bugs:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mootools-behavior-0.1.tar.gz (17.0 kB view details)

Uploaded Source

File details

Details for the file django-mootools-behavior-0.1.tar.gz.

File metadata

File hashes

Hashes for django-mootools-behavior-0.1.tar.gz
Algorithm Hash digest
SHA256 40a750468b49d3994cffa62270976f4f413a5b0933043f059ffc832cefdd596e
MD5 8f51d88e92ddf0ce5d14ecc5c901d593
BLAKE2b-256 02c5f1da61e48bad0bd7d3d3939813eafea24dd911d7a5910632326fc2be0635

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page