Special thanks in this release to James Friedman @jamesmfriedman, for his amazing support in PR #213, adding Bootstrap 3 support.
- Moved
UneditableField
to bootstrap module, place where it should live, no backwards compatible import left behind. - Added
bootstrap3
template pack thanks to James Friedman, see #213 and #209. RadioSelect
andCheckboxSelectMultiple
widget values and texts were being localized, when they shouldn't bee, see #214.- If Django widget attrs where set for
RadioSelect
orCheckboxSelectMultiple
they were not being rendered by crispy-forms, see #206. form_show_labels
wasn't working correctly with some layout objects, see #193.
- Labels were not being rendered with
|crispy
filter, see #202.
- Fix default value for
form_show_labels
in case FormHelper doesn't define it, see #199. - Added a backported version of
override_settings
for testing django 1.3.7 and adding it to Travis-ci matrix.
Special thanks in this release to Charlie Denton @meshy, for his amazing support in PRs #189 and #190, long due.
- Deprecated
Tab
andTabHolder
imports fromlayout.py
module, they now live inbootstrap.py
module. - Removed Python 2.5 compatibility.
- Added
disable_csrf
helper attribute, see docs. - Travis-ci support thanks to Charlie Denton, see #190.
- Python 3 compatibility thanks to Charlie Denton, see #189 and #190.
- Added a settings variable named
CRISPY_ALLOWED_TEMPLATE_PACKS
for adding easily support for new template packs, see #192. - Added
{% crispy_addon %}
tag, see #195. - Make
CRISPY_TEMPLATE_PACK
optional for tests - Make tests run the same exacty way with
runtests.py
andmanage.py test
, see #183. - Bug fix for
wrap_together
when using it with partial slices. - Fixes for
KeepContext
context manager, see #180. - Added
FormHelper.field_template
attribute, for easily override field template for a specific form/formset, see docs. - Added a template for rendering formsets inline within tables named
bootstrap/table_inline_formset.html
, that can be easily used in conjunction withFormHelper.template
. - Added
FormHelper.template
attribute, that easily allows to override form/formset general structure template, see docs. - Added
form_show_labels
helper attribute. - Redoing filters to use
isinstance
instead of hacky internal name checking, this way subclasses of standard fields will work out of the box with crispy-forms, see #176.
- Bug fix for
KeepContext
context manager, when crispy-forms used with Jingo/Jinja2 templates, see #179. - Some formset tests were breaking in some Django versions. Also added a
make test
for easily running project tests, see #178.
- Bug fix for model formsets and inline formsets, when being rendered with a
FormHelper
with a layout set, where some hidden formset management fields would be missing, breaking saving to database. - Added
render_hidden_fields
attribute toFormHelper
, see docs. - Added
render_hidden_fields
attribute toFormHelper
, see docs.
- Fixes to
Container
andTabHolder
, affecting class variable helpers with layouts containingTabHolder
orAccordionGroup
objects, see #172. - Bug fix for
KeepContext
context manager, see #172.
- Avoid raising Exceptions in
|as_crispy_field
filter when not in DEBUG mode. - Popping
css_id
to avoid having a css-id attribute, see #167. - Fixed a bug in dynamic layout API, when wrapping layout objects that had arguments passed after fields. Moving
LayoutSlice
tolayout_slice
module. - Fixed test failing when tests runned from manage.py test.
- Fixed testing name conflict, see #130.
- Added
wrapper_class
kwarg toField
layout object, see #163. - Added
Accordion
andAccordionGroup
bootstrap layout objects, see #162. - Bug fix in
render_crispy_form
to avoid override existing context, see #153. - Use formset iterator instead of
forms
list attribute, see #152. - Don't display fieldset legend if empty, see #147 and #155.
- Bug fix for pickling crispy forms by powderflask, see #107.
- Switched from
django.form.utils.flatatt
to internalflatatt
utils implementation, this allows adding data-attrs toFormActions
andStrictButton
. render_field
now uses a context manager to avoid side effects when layout objects update template context. This makes context mutability safe within layout objects.- Added
greedy
kwarg tofilter
dynamic API. - Fixing error logging on
|as_crispy_field
filter, see #135. - Implemented
__delitem__
,__len__
and__setitem__
inLayoutObject
andDynamicLayoutHandler
, this avoids pylint warnings, see #114. - Docs folder no longer included when installing crispy-forms, see #132.
- Added
wrap_once
,update_attributes
,map
andpre_map
to LayoutSlice.
- Fixed imports to be relative to package, avoiding namespace collisions.
- Removed circular dependency between
layout
andbootstrap
, see #129. - Bug fix, adapted use of inspect module in
utils.py
to avoid breaking Python 2.5 compatibility.
- Bug fix, reduction of white space in crispy-forms output could mess within tags, see #127, reverting part of this reduction.
- Renamed
AppendedPrependedText
toPrependedAppendedText
. - Moved
Tab
andTabHolder
tobootstrap.py
.
- Bug fix
help_text_inline
set to True, see #117. - New fix for the space between buttons problems, see #62.
- Reduced importantly whitespace in html generated by crispy-forms, forms are now more compact.
- Added support for specifying a template pack per form, see #66 and #109.
- Removed
clearfix
class from bootstrap templates, not necessary anymore, see #105. - Space cleanup in bootstrap templates, thanks to Si Feng, see #122.
- Fixed
MultiField
to work withform_show_errors
helper attribute. - Fixed a bug in
MultiField
that set error class when there were form errors, no matter if the fields with errors were contained within, see #120. FieldWithButtons
now supportsField
layout object as its first parameter, for setting input attributes.- Bug fixes for
FieldWithButtons
, field label,help_text
or error messages were not being rendered, see #121. - Fixed a bug that was making crispy-forms render extra fields with ModelForms that didn't have
Meta.fields
defined, thanks to Jean-Baptiste Juin for reporting it. - Fixed a bug that was breaking Django 1.2 compatibility when copying context variables, thanks to Alex Yakovlev for submitting a patch, see #108.
- Fixed a bug for
AppendedText
,PrependedText
andAppendedPrependedText
layout objects, thanks to Bojan Mihelac, see #104. - Fixed a bug in appended and prepended text layout objects for respecting hidden fields, thanks to Bojan Mihelac, see #103.
- Added two new bootstrap layout objects:
FieldWithButtons
andStrictButton
. - Added checks and better error messages for dynamic API.
- Fixed
get_layout_objects
recursive call for Python2.5 compatibility, thanks to Can Başçıl for reporting it.
- Update prepended and appended templates to respect hidden fields, thanks to Bojan Mihelac, see #GH-103.
- Added
InlineCheckboxes
to bootstrap layout objects, for rendering checkboxes inline. BaseInput
subclasses, likeSubmit
can now have its value set to a context variable.- Rendering inputs added with
add_input
in bootstrap using the right templates, see #GH-95. - Improved formsets rendering docs thanks to Samuel Goldszmidt, see #GH-92.
- Added
Tab
andTabHolder
layout objects thanks to david-e, see #GH-91. - Fixed default bootstrap button default classes thanks to david-e, see #GH-90.
- Fixed some flaws in new testing structure by Markus Hametner.
- Added helper attribute
error_text_inline
thanks to Lee Semel for controlling how to render form errors, as a block or inline, see #GH-87. - Support
ModelMultipleChoiceField
oncheckboxselectmultiple
, see #GH-86. - Redoing testing structure a litte bit, to run uni_form and bootstrap tests separately. They share most of the code base, but templates pack are separate and we need to care both have the same quality assurance.
AppendedText
,PrependedText
andAppendedPrependedText
were not respectingform_show_errors
helper attribute, see #GH-77.- Added a version string to the app under root init, see #GH-76.
- Added
html5_required
helper attribute for rendering required fields using HTML5 required attribute within the input, see #GH-72. Thanks to Lloyd Philbrook. - Some docs typos and errors fixed, also a major upgrade to docs covering the new functionality.
- Adding a
utils.render_crispy_form
function, that renders a form the crispy way in Python code. This might be useful with AJAX, testing or text generation/manipulation, see #GH-64. - Tiny cosmetic fix, that adds an space after a button, see #GH-62.
MultiField
andFieldset
layout objects can now have any kind of attribute defined, thanks to Lloyd Philbrook, see #GH-71.- Making
Fieldset
,MultiField
&HTML
contents lazy translatable thanks to Rivo Laks, see #GH-69. - Fixing
radioselect
checked status when used for a FK in a ModelForm, see #GH-68. - Fixing
form.Meta
usage, using instancefields
instead of staticMeta
definition, so that it works when updating forms on the go, see #GH-59. - Added a low level manipulation API for layout and layout objects. Added a
LayoutObject
base class that creates an interface. This allows to access nested fields easily and use list methods without know internals of the system. - Added a
|classes
filter that returns field's classes. - Now
FormHelper
can accept a form instance as an optional first argument, from which it can build a default layout. - Added an API for manipulating dynamic layouts and programmatic layout building.
- Added
UneditableField
bootstrap layout object for uneditable fields. - Support for hiding fields using
Field('field_name', type="hidden")
, see #GH-55. - Avoid template context pollution of variable
form
after using {% crispy %} tag, see #GH-54. - Added an
attrs
helper attribute, for more flexible form attributes, see #GH-48. - New
AppendedPrependedText
layout object thanks to Samuel Goldszmidt, see #GH-45. - Removal of some whitespace in crispy form's HTML generated, see #GH-42.
- New
MultiWidgetField
layout object by Michal Kuffa, see #GH-39.
- Multithread safety improvements for
BasicNode
. - Security fix: Thread safety fixes to
CrispyFieldNode
thanks to Paul Oswald. This avoids leaking information between requests in multithreaded WSGI servers. - Added css class
control-label
toAppendedText
andPrependedText
layout object's templates. {% crispy field %}
tag can now pass attrs toMultiWidget
subclasses by Michal Kuffa.attrs
are set for sub-widgets. Alsoattrs
can now be an iterable for passing different attributes to different sub-widgets. For example,this way MultiWidget's widgets get css classes set correctly.- Turning underscores into hyphens for
Field
layout objects. - Fix for
ChoiceFields
using non-string choices with radio buttons thanks to Rudy Mutter. See #GH-46, #GH-43 and #GH-35.
|crispy
and|as_crispy_field
filters were not rendering errors. Thanks to @ximi for reporting it and submitting a patch. See issue #GH-28.- Fixing a test that was breaking when language was not English. Thanks to @gaftech, see #GH-30.
- Fixing
radioselect.html
andcheckboxselectmultiple.html
templates. Thanks to Christopher Petrilli for submitting a patch forradioselect
. See issue #GH-35. - HTML attributes can now be set in
BaseInput
subclasses likeButton
by @jamesmfriedman. See #GH-32. - Fix for dynamic crispy-forms with Meta classes by Jeroen Vloothuis. See #GH-37.
- Labels now use
id_for_label
instead ofauto_id
to avoid ids breaking on multiwidgets. by Daniel Izquierdo. See #GH-38. - Adding a flatatt custom function in
utils.py
for flatting extra HTML attributes. - HTML attributes can now be set in
Div
layout object. - Adding tests for new functionality and bugs.
- input name attribute is no longer slugified if only one word is provided, respecting caps.
- Changes in bootstrap global error templates by David Bennett.
- Added class
control-label
to labels, for horizontal layout thanks to bitrut. - Using
{{ field.html_name }}
instead of{{ field.name }}
in field templates, so that they work with form prefixes (formwizard) by Patrick Toal. - Fixing error rendering in bootstrap AppendedText and PrependedText.
- Applying
field.css_classes
in bootstrapfield.html
instead of widget classes. - Fixes for bootstrap simple checkbox input to be wrapped correctly.
- Fixing a critical bug in bootstrap templates, that was breaking
{% load crispy_forms_tags %}
- Fixing produced html by a checkbox field, closing label the right way and rendering checkbox in the right place.
- Passing full context to field rendering, to be consistent and having acess in
field.html
template to helper attributes. - Custom helper attributes can now be set and will be part of templates context, this way you can define custom specific behavior.
- Adding @kennethlove bootstrap template pack into django-crispy-forms core.
- Adding
CRISPY_TEMPLATE_PACK
setting variable to easily switch between different template packs. Default template pack is now bootstrap. - Upgrading bootstrap templates, fixing some bugs and redoing the hierarchy.
- Upgrading tests for multiple template packs.
- Renaming
UNIFORM_FAIL_SILENTLY
setting variable toCRISPY_FAIL_SILENTLY
, upgrading migration instructions. - Redoing bootstrap
field.html
template to renderradioselect
andcheckboxselectmultiple
Django widgets a la bootstrap. - Adding a
render_unmentioned_fields
helper attribute, that renders all fields in a form, no matter what the layout is. Default isFalse
. - Adding a
|css_class
filter that renders field classes in an elegant way. - Turning
|with_class
filter into{% crispy_field %}
tag, so that parameters for rendering the field can be passed. - Adding a
help_text_inline
helper attribute, that controls wether to render help texts in bootstrap with "help-inline" or "help-block". - Adding a
flat_attrs
variable to the context passed tofield.html
to be able to do all kind of html attributes when rendering a field, usingField
layout object. - Adding a
template
kwarg toField
layout object that allows to override template used for rendering a field. - Adding a
bootstrap.py
module that holds bootstrap specific layout objects, for higher bootstrap integration. - Adding a
AppendedText
,PrependedText
andFormActions
bootstrap layout objects. First two based in polyvalentField
layout object.
- Using
baseinput.html
template withinwhole_uni_form.html
, to be DRY and consistent. BaseInput
subclasses likeSubmit
can now have ids set, ussingcss_id
- Adding a simplified alternative syntax for
{% uni_form %}
tag. We can now do{% uni_form form %}
for rendering a form using a helper, instead of{% uni_form form form.helper %}
, if theFormHelper
attribute attached to the form is namedhelper
. - Improving
rendered_fields
checking performance. - Layouts are now rendered strictly. We don't render fields missed in the layout. If the form has a Meta class with
fields
orexclude
, then we follow Django standards. - Added
Field
layout object. You can wrap name fields within and set all kind of attributes easily or override widget template. - Fixed #GH-111 we were not rendering all the classes in
|with_class
filter - Moving django-uni-form to django-crispy-forms. Renaming tags, filters and modules. Updating tests and so on. Adding migration instructions.
- More work on simpler and easier docs.
- Adding
form_show_errors
helper attribute, that controls wether to render or notform.errors
- Improving template hierarchy for more template code reusability.
You can read on how to use new features included in this version at: http://tothinkornottothink.com/post/10398684502/django-uni-form-0-9-0-is-out-security-fix
- Fixed a bug in
|with_class
filter so that it supportsshow_hidden_initial
, see #GH-95 to not break. - Fixed a problem on Fieldset's legends internationalization. Thanks to Bojan Mihelac, see #GH-90.
- Fixed XSS bug thanks to Charlie Denton, see #GH-98. Errors cannot be rendered safe, because field's input can be part of the error message, that would mean XSS.
- Updating and improving docs, adding more use case examples.
- Split
helpers.py
file intohelper.py
,layout.py
andutils.py
. Added a deprecation warning. - Improved testing coverage, specially for formsets and i18n.
- Improved rendering performance of
{% uni_form %}
tag and|as_uni_form
filter avoiding reloading templates every time, see #GH-81. - Added support for Django
Form.error_css_class
andForm.required_css_class
custom CSS classes, see #GH-87. - Moved template code in Layout objects into separate files in
uni_form/layout
directory. Layout objects templates can now be easily overriden, see #GH-37. form_style
can now be used without having to set a helper Layout, see #GH-85.form_action
is not lowered anymore andform_action
is set to "" by default instead of "." thanks to Jianbo Guo, see #GH-84.Multifield
field templatemultifield.html
markup fixed, addinghelp_text
support and removinglabelclass
from labels.- Fixed testing suite, when run not using
DjangoTestSuiteRunner
provided, thanks to Narsil #GH-82. - Removed test_project from the project.
- Improved
MultiField
performance avoiding instantiating BoundFields twice. - Fixed a bug in
MultiField
that raised an exception when internal fields had errors, because ofself.css
not existing. - Added an extra optional parameter to
render_field
calledlayout_object
, used for storing in it a list of bound fields. - Refactor all Layout objects to use templates and not having hardcoded HTML in the code, based on Jonas Obrist work. Resolves Issue #GH-37
- Added a Layout object called
Div
.Row
andColumn
both inherit fromDiv
Layout
can now be a child ofLayout
, see issue #GH-76.
You can read on how to use new features included in this version at: http://tothinkornottothink.com/post/7339670508/new-kung-fu-in-django-uni-form-0-8-0
-
Elevated Miguel Araujo to project lead!
-
Added a forloop simulator for formset forms rendering.
-
ButtonHolder
Layout object added for holdingHTML
and buttons:Submit
,Reset
,Button
. -
Turned BaseInput inherited objects like:
Submit
,Reset
,Hidden
andButton
into Layout objects. -
Fixed a bug with
rendered_fields
when no fields where in the Layout. -
Fieldset
legends are now templates full context aware. -
Based on @issackelly's and @johnthedebs's work a template called
betterform
has been added for supporting @carljm's form-utils BetterForms. -
FormHelper
methodget_attr
has been renamed toget_attributes
-
uni_form_tags
has been split into two different files:uni_form_tags
anduni_form_filters
. -
Removing i18n tags from the templates, as they are not necessary anymore.
-
Removed all the internationalized hardcoded text, in favor of template variables:
form_error_title
andformset_error_title
, both can be set as helper's attributes. -
as_uni_errors
filter can now render formset'snon_form_errors
uni-form way. -
Moved
{% uni_form_setup %}
tag to use STATIC_URL instead of MEDIA_URL -
Added the possibility to specify a helper for formsets too.
-
Renamed media directory to static, to be compatible with Django 1.3 staticfiles.
-
Added a
form_style
FormHelper attribute for setting global style of a form: inline or default. -
Turning
HTML
into a full context aware django template field, having access to the whole context of the template in which the form is rendered. -
Turning
Layout
andFieldset
fields attributes into lists, so that they can be changed dynamically. -
Changing formHints from paragraphs to divs, so ul or ol can be placed within.
-
Removing slugify filter from form ids, so they can be set as user's preferences.
-
Added CSS class 'asteriskField' for asterisks. Added CSS class 'fieldRequired' for required input labels.
-
UNIFORM_FAIL_SILENTLY
variable setting has been added for making django-uni-form log errors and fail silently, based on Adam Cupiał's work. -
Several bug fixes in
MultiField
. -
Added unicode support for layout field names and improved error handling.
-
Refactored testing system and raised testing coverage.
-
Clean part of the code base and comments. All old CSRF code for supporting old versions of Django has been removed.
-
Refactored BasicNode for better readability and reducing lines of code.
-
Added formsets support based on Victor Nagy's (nagyv) and Antti Kaihola's (akahiola) work.
-
Bug fix in
{% uni_form %}
tag that didn't work without a helper and it was meant to be optional. -
CSS classes can be set in Submit buttons.
-
Thanks to J. Javier Maestro (jjmaestro) now we can set ids and classes for
Fieldset
,MultiField
,Row
andColumn
. -
Thanks to Richard Marko (sorki) changed CSS class of PasswordInput widget.
-
Removing
Toggle
class as it wasn't being used anywhere. -
Moved
BaseInput
to helpers and removedutil.py
file. -
Removed
{% uni_form_jquery %}
tag -
Removed
namify
function from tags, as It wasn't being used anywhere. -
Improved internal documentation
-
form methods generated by FormHelper are in lowercase (http://github.com/pydanny/django-uni-form/issues#issue/20)
-
Thanks to Nagy Viktor added form_tag attribute to FormHelper. Now you can use the uni_form tag without the leading and trailing form tags.
-
Thanks for Alison Rowland for giving django-uni-form sphinx docs
-
Incorporated uni-form 1.4 by Dragan Babic
-
Provide better adherence to uni-form specification of error messages
-
mirumee provided some great work for making FormHelper more subclassable.
-
django-uni-form 0.8 and higher lays out the HTML for the uni_form tag differently. The errorMsg div is now outside the fieldset as it should be.
-
Thanks to Casper S. Jensen django-uni-form now supports 1.2 style csrf_token.
-
csrf_token does not break earlier versions of Django. This will change when no version of django does not support csrf_token.
-
Thanks to j0hnsmith changed {{ error }} to {{ error|safe }} so that html (eg links) can be added to error messages.
-
Thanks to j0hnsmith changed {{ field.label }} to {{ field.label|safe }} so that html (eg links) can be added to field labels
-
Kudos to Stepan Rakhimov fixed an admin datetime issue.
-
Thanks to patrys (Patryk Zawadzki) FormHelper class is now easily subclass-able.
-
Sorki (Richard Marko) made it so things work better in direct_to_template.
- Removed a
from the layout module. - Changed templatetags/uni_form.py to templatetags/uni_form_tags.py. Yes, this breaks backwards compatibility but fixes a namespace problems in Django with naming a templatetag library after the parent application.
- Changed form_action attribute to accept not just named URLs but also any old URL.
- Added in uni_form_setup tag.
- Added tests
- Added several new contributors including Dragan Babic
- Added Danish language translation