Django Formsets with ECMAScript 6.
Project description
django-easy-formset
Django Formsets with ECMAScript 6
Installation
Installation is easy using pip and the only requirement is a recent version of Django.
python -m pip install django-easy-formset
Basic app configuration
Then to add the Django Easy Formset to your project add the app easy_formset
to
your INSTALLED_APPS
.
INSTALLED_APPS = [
# ...
"easy_formset",
]
How to use
{% load static %}
...
<div id="{{ formset.prefix }}">
{{ formset.management_form }}
<template formset-empty-form>
{{ formset.empty_form.as_p }}
<a formset-form-delete>Delete</a>
</template>
<div formset-forms>
{% for form in formset.forms %}
<div formset-form>
{{ form.as_p }}
<a formset-form-delete>Delete</a>
</div>
{% endfor %}
</div>
<button formset-add>Add Formset</button>
</div>
<script src="{% static 'easy_formset/easy_formset.js' %}"></script>
<script>
const formset = new Formset("{{ formset.prefix }}")
</script>
...
Run tests
python -m pip -r requirements.txt
pytest
Run project test
python manage.py runserver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-easy-formset-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30b6addd737389d03e3759137b62d17365f31ce92e6400deaa3f151b4ccd0acc |
|
MD5 | d902a98726b7d673708863a0dbfc0974 |
|
BLAKE2b-256 | 9572801ec6c4ddfa05eafeb9f40d3bb91fc89c0d16899473b476b586bd84aa9a |
Close
Hashes for django_easy_formset-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a03c9bca2d16033faf20ebbd6ed7c06fad1be1c5e36667dc0ef93afe27c95feb |
|
MD5 | 1d95022c49a2e2cf71075249e8384e54 |
|
BLAKE2b-256 | 504dbdb0c27b8d64ba45fb5ff0928ff10599daa4e54eabdb2aca6e0ee1632d70 |