Package: django-floppyforms
Full control of form rendering in the templates.Authors: Gregor Müllegger and many manycontributorsOriginal creator: Bruno Renié started this project and kept it going for many years.Licence: BSDRequirements: homework – readthis.Installationpip install-Udjango-floppyformsAddfloppyformsto yourINSTALLED_APPSFor those who want to mix and match with vanilla Django widgets, it is also recommended
to put Django’s form template directory into your template directories:# in your template configuration
TEMPLATES = [{
    ...,
    # inside the directories parameter
    'DIRS': [
        # include django's form templates
        os.path.join(
            os.path.dirname(django.__file__), "forms/templates/"
        ),
        ... # the rest of your template directories
}]For extensive documentation see thedocsfolder orread it on
readthedocsTo install thein-development versionof django-floppyforms, runpip install"https://github.com/jazzband/django-floppyforms/tarball/master#egg=django-floppyforms".HelpCreate a ticket in theissues section on githubor ask your questions on the
#django-floppyforms IRC channel on freenode.You can get professional consulting regarding django-floppyforms or any other
Django related work from django-floppyforms’ maintainerGregor Müllegger.BugsReally? Oh well… Please Report. Or better, fix :) We are happy to help you
through the process of fixing and testing a bug. Just get in touch.DevelopmentThanks for asking!Get the code:git clone git@github.com:jazzband/django-floppyforms.git
cd django-floppyforms
virtualenv env
source env/bin/activate
add2virtualenv .Install the development requirements:pip install "tox>=1.8"Currently, you’ll need toinstall the GeoDjango requirementswhen running tests.Run the tests:tox
tox -e py36-22You can see all the supported test configurations withtox-l.Changelog1.9.0This release changes the compatibility matrix for the project.We now support the following Django releases:Django 2.2Django 3.0We are also testing under the following Python versions:Python 3.6Python 3.7Python 3.8No other significant changes in this release, but Django 1.11 and 2.1
are no longer supported.1.8.0This is the first release to be done under the Jazzband organization.It collects several compatibility fixes to support Django 1.11 and 2.1.The currently tested versions ofdjango-floppyformsis now:Django 1.11 and Python 2.7 or 3.6Django 2.1 and Python 3.6In principle, we want to support any reasonable combination of Django and Python that still receives security releases, so if you are using an untested combination and hit an issue, bug reports are welcome.Breaking Change:Because Django’s widgets now render through a form-specific template renderer, butfloppyformswidgets
use the standard rendering template (that doesn’t automatically include Django’s form templates), it is
recommended to manuallyput Django’s form template directory directly into your own template backend
configuration.If you don’t add the following, you might experience issues mixing and matching vanilla widgets with
floppyform widgets:import django

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            ..., # your other template directories
            # django's own form template directories
            os.path.join(os.path.dirname(django.__file__), "forms/templates/",
        ],
        ...
    },
    ...
]#176: Fix HTML validation for hidden textarea used with GIS widgets.#191+#196+#209: Support for Django 1.11 and 2.1. Thanks to MrJmad and dryice for patches.#194: Remove official support for Python 2.6 and Python 3.2.#204: Use HTTPS for OpenStreetMap links. Thanks to dryice for the patch.1.7.0#171: Fix path to GIS widget images inopenlayers.htmltemplate. The
files coming with Django admin where used, but the naming changed in 1.9. We
vendor these know to have better control over it.#174: Support for setting your own Google Maps key in theBaseGMapWidget.See the documentationfor
details1.6.2#169: Use the attributesClearableFileInput.initial_text,ClearableFileInput.input_text,ClearableFileInput.clear_checkbox_labelto determine the used text in the
template. This was inconsistent so far with Django’s behaviour.1.6.1#167: Fix django-floppyforms’CheckboxInput.value_from_datadictwhich
was inconsistent with Django’s behaviour.1.6.0#160: Django 1.9 support! Thanks to Jonas Haag for the patch.1.5.2#156: Themin,max,stepattributes forDecimalFieldandFloatFieldwere localized which can result in invalid values (rendering0.01as0,01in respective locales). Those attributes won’t get
localized anymore. Thanks to Yannick Chabbert for the fix.1.5.1FloatField`now fills inmin,max, andstepattributes to match
the behaviour ofDecimalField. Leaving out thestepattribute would
result in widgets that only allow integers to be filled in (HTML 5 default
forstepis1).1.5.0#148: Added support for customlabel_suffixarguments in forms and fields.The contents infloppyforms/input.htmlis now wrapped in a{% block content %}for easier extending.#70:DecimalField`now fills inmin,max, andstepattributes for
better client side validation. Use thenovalidateattribute on your<form>tag to disable HTML5 input validation in the browser. Thanks to
caacree for the patch.1.4.1Fixed source distribution to include all files infloppyforms/static/floppyforms/openlayers.1.4.0Every widget is now using its own template. Previously all widgets that are
based on the HTML<input>tag used the genericfloppyforms/input.htmltemplate. Now the widgets each have a custom element for easier
customisation. For exampleCheckboxInputnow usesfloppyforms/checkbox.htmlinstead offloppyforms/input.html. SeeWidgets referencefor a complete list of available widgets and which templates they use.Adjusting the SRIDs used in the GeoDjango widgets to conform with
Django 1.7. Thanks to Tyler Tipton for the patch.Python 3.2 is now officially supported.Django 1.8 is now officially supported. django-floppyforms no longers
triggers Django deprecation warnings.AddingOpenLayersdistribution to django-floppyforms static files in order
to better support HTTPS setups when GIS widgets are used (See #15 for more
details).Fix:python setup.py bdist_rpmfailed because of wrong string encodings
in setup.py. Thanks to Yuki Izumi for the fix.Fix: TheCheckboxInputwidget did detect different values in Python 2
when given'False'andu'False'as data. Thanks to @artscoop for the
patch.Fix:MultipleChoiceFieldcan now correctly be rendered as hidden field by
using theas_hiddenhelper in the template. That was not working
previously as there was no value set forMultipleChoiceField.hidden_widget.1.3.0DateInput widget renders hardcoded “%Y-%m-%d” format. We don’t allow custom
formats there since the “%Y-%m-%d” format is what browsers are submitting
with HTML5 date input fields. Thanks to Bojan Mihelac for the patch.Addingsupports_microsecondsattribute to all relevant widget classes.
Thanks to Stephen Burrows for the patch.Using a property forWidget.is_hiddenattribute on widgets to be in
conformance with Django 1.7 default widget implementation.The docs mentioned that the currentModelFormbehaviour infloppyforms.__future__will become the default in 1.3. This is postpone
for one release and will be part of 1.4.1.2.0Subclasses offloppyforms.models.ModelFormdid not convert widgets of
form fields that were automatically created for the existing model fields
into the floppyform variants. This is now changed, thanks to a patch by
Stephen Burrows.Previously you had to set the widgets your self in a model form. For example
you would write:import floppyforms as forms

class ProfileForm(forms.ModelForm):
    class Meta:
        model = Profile
        widgets = {
            'name': forms.TextInput,
            'url': forms.URLInput,
            ...
        }Now this is done automatically. But since this is a kind-of
backwardsincompatible change, you need to use a special import:import floppyforms.__future__ as forms

class ProfileForm(forms.ModelForm):
    class Meta:
        model = ProfileThis feature will become the default behaviour in floppyforms 2.0.See the documentation for more information:http://django-floppyforms.readthedocs.org/en/latest/usage.html#modelformsIf you added an attribute with value 1 to the attrs kwargs (e.g.{'value': 1}, you would get no attribute value in the rendered html (e.g.valueinstead ofvalue="1"). That’s fixed now, thanks to Viktor Ershov for the
report.All floppyform widget classes now take atemplate_nameargument in the__init__andrendermethod. Thanks to Carl Meyer for the patch.1.1.1Fix for Django 1.6Fix for GIS widgets on Django 1.4 and some versions of GEOS.1.1Added GenericIPAddressField.Django 1.5 and Python 3.3 support added.Django 1.3 support dropped.GIS widgets switched to stable OpenLayers release instead of a dev build.FixedTextareawidget template to work with a non-emptyTEMPLATE_STRING_IF_INVALIDsetting. Thanks to Leon Matthews for the
report.Fixed context handling in widget rendering. It didn’t take care of popping
the context as often as it was pushed onto. This could cause strange
behaviour in the template by leaking variables into outer scopes. Thanks to
David Danier for the report.Added missing empty choice for selectboxes inSelectDateWidget. Thanks
fsx999 for the report.IntegerFieldnow automatically passes itsmin_valueandmax_value(if provided) to theNumberInputwidget.Added basic support for<datalist>elements for suggestions inInputwidgets.date,datetimeandtimeinputs are not localized anymore. The
HTML5 spec requires the rendered values to be RFC3339-compliant and the
browsers are in charge of localization. If you still want localized
date/time inputs, use those provided by Django or override the_format_value()method of the relevant widgets.1.0cleaned up the behaviour ofattrscompatible with Django 1.3 and 1.4<optgroup>support in select widgetsSelectwidgets: renamedchoicescontext variable tooptgroups.
This isbackwards-incompatible: if you have custom templates forSelectwidgets, they need to be updated.get_context()is more reliableAddedform,formrow,formfield,formconfigandwidgettemplate tags.Added template-based form layout system.Added ability to render widgets with the broader page context, for
instance for django-sekizai compatibility.0.4All widgets from Django have their floppyforms equivalentAdded widgets for GeoDjango