Commit graph

13 commits

Author SHA1 Message Date
Serg Tereshchenko
25b6011a1f style: Apply black 2021-09-18 10:55:39 +03:00
Thijs Boehme
1bff76dc02
Update to use gettext_lazy
The use of `ugettext` and variants is deprecated in Django 3.0 and to be removed in Django 4.0.
See more here: https://code.djangoproject.com/ticket/30165
2020-03-04 12:24:05 +01:00
Maciej Wiśniowski
70ad126d7c added renderer attribute for django 2.1 compatibility 2018-09-11 10:05:30 +02:00
Mariusz Felisiak
5f66a44649
Removed unused code.
Unused since cc214e3c66.
2017-06-23 06:49:38 +02:00
Jacek Tomaszewski
81c9d55c1e Make ClearableWidgetWrapper compatible with Django 1.6 (_has_changed). 2013-10-11 21:51:10 +02:00
Jacek Tomaszewski
b38949aaa5 Remove tabindex on ClearableWidgetWrapper. 2013-10-11 21:38:22 +02:00
Jacek Tomaszewski
88b90fabae Use ugettext_lazy instead of ugettext (close #202). 2013-10-10 16:07:01 +02:00
wrwrwr
4cc0d2b25e Python 3 compatiblity: no unicode literals for 3.2 and safeguard against loop during copy operation. 2013-05-15 16:50:14 +02:00
wrwrwr
7cd60aa977 Added a small script unchecking the clear box after a wrapped input is edited.
Note: Starting global declaration, and the somewhat ugly jQuery call are for JSLint.
Also written a class comment for the widget wrapper and cleaned up some Flake8 errors.
2013-05-15 12:01:46 +02:00
wrwrwr
22faea9646 Reworked the solution by replacing clearable widgets with a widget wrapper. This makes it possible to wrap only widgets of nullable fields, and thus not add the clear checkbox when it's not needed.
The implementation is loosely based on RelatedFieldWidgetWrapper from contrib.admin, but uses a bit more Python magic; tested only with TextInput and Textarea widgets and their admin counterparts, but with a bit of luck should work with other widgets too.
2013-05-14 22:21:03 +02:00
wrwrwr
59199bb282 Made the widget template for nullable fields unicode, so the widget renders with non-ascii characters in input value. 2013-04-03 18:14:55 +02:00
wrwrwr
befae736c0 Replaced format_html with mark_safe/conditional_escape for Django < 1.5 compatibility. 2013-03-24 18:31:45 +01:00
wrwrwr
97d966244d Implemented a widget that shows a clear checkbox for any non-required form field.
Overriden admin widgets of CharFields and TextFields and patched forms.CharField for nullable fields, so undefined translations don't get filled with empty strings when an admin form is saved (thus becoming defined in the case of a nullable field).
2013-03-24 17:59:21 +01:00