Commit graph

348 commits

Author SHA1 Message Date
Jacek Tomaszewski
656dca3e40 Show None checkboxes on form fields, especially admin (close #187). 2013-10-10 23:05:26 +02:00
Jacek Tomaszewski
ca11558bd9 Fix compatibility with older jQuery. 2013-10-10 22:57:59 +02:00
Jacek Tomaszewski
8a2c8b894e Add more prepopulated_fields tests. 2013-10-10 16:54:15 +02:00
Jacek Tomaszewski
c7f0eee273 Don't import individual settings. 2013-10-10 16:47:56 +02:00
Jacek Tomaszewski
489e2db145 Merge remote branch.
Fix _patch_prepopulated_fields (close #190, #181).
2013-10-10 16:45:39 +02:00
Jacek Tomaszewski
88b90fabae Use ugettext_lazy instead of ugettext (close #202). 2013-10-10 16:07:01 +02:00
Jacek Tomaszewski
73d845921a Make every manager MultiLingual, not only objects (close #198). 2013-10-10 15:27:27 +02:00
Jacek Tomaszewski
74df71bdf2 Merge pull request #163 from wrwrwr/feature/no-empty-string-fallback-for-nullable
Fallback on field default rather than the empty string
2013-09-01 10:52:00 -07:00
Dirk Eschler
d7ace001f2 Fixed flake8 errors. 2013-08-27 12:18:42 +02:00
Konrad Wojas
b9d8359306 Added MODELTRANSLATION_PREPOPULATE_LANGUAGE setting to force prepopulated fields (slugs) to use a specific language as their source 2013-07-23 16:07:41 +08:00
Rafleze
23ca52ceef Update admin.py
Improvements on _patch_prepopulated_fields
2013-07-08 21:22:58 +02:00
Dirk Eschler
cc5687e4d0 Merged test-unique-nullable-fields branch into master. 2013-06-18 11:09:14 +02:00
Dirk Eschler
a51e5d0c39 Merged pull request #186. 2013-05-27 12:18:41 +02:00
deschler
20d7e21809 Added basic ProxyModel test cases (ref #185). 2013-05-26 20:22:39 +02:00
deschler
a26bdd8041 Fixed flake8 errors. 2013-05-23 23:11:54 +02:00
cuchac
dfc49971dc Fix #179: --noinput option for the sync_translation_fields command 2013-05-23 13:43:31 +02:00
wrwrwr
d95258cd02 Test updating existing translation with an empty value through a form that doesn't include the original, translated field. 2013-05-16 12:29:25 +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
027349bd9a Set self to something in the replace_orig_field doctest, so PyFlakes doesn't complain. 2013-05-15 12:37: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
b9494f7607 Merge branch 'master' into feature/no-empty-string-fallback-for-nullable
Conflicts:
	modeltranslation/admin.py
	modeltranslation/fields.py
	modeltranslation/translator.py
2013-05-13 13:34:37 +02:00
Dirk Eschler
412943ba83 Added basic test class for TranslationModelForm. 2013-04-08 12:24:31 +02:00
Dirk Eschler
d9967525a4 Added a new forms module with a TranslationModelForm which removes the translation fields (thanks to Dylan Verheul). 2013-04-08 12:23:10 +02:00
Jacek Tomaszewski
11e77b4c31 Remove Python 2.5 compatibility code. 2013-04-08 11:57:46 +02:00
Jacek Tomaszewski
3465486da4 Remove Django 1.3 compatibility code. 2013-04-08 11:55:31 +02:00
Jacek Tomaszewski
e04073a7ec Preserve default fields order in group_fieldsets. 2013-04-08 11:41:06 +02:00
Jacek Tomaszewski
b7ea1fac4c Further work towards Python 3 support. 2013-04-08 11:41:06 +02:00
Kudlaty
69f6bfc75f Use six.with_metaclass instead of some hack. 2013-04-08 11:41:06 +02:00
deschler
e4d772940e Fixed flake8 complaints. 2013-04-08 11:41:06 +02:00
Kudlaty
966c0f38ad Initial work towards python 3 support 2013-04-08 11:41:06 +02:00
Jacek Tomaszewski
3bdbe4eb2c Fix _mt_init attribute deletion (close #176). 2013-04-08 11:37:27 +02:00
deschler
2d63001edd Added convenience admin classes for easier inclusion of tabbed translation fields static files (closes #171). 2013-04-05 02:14:59 +02:00
Jacek Tomaszewski
a203a65a3c Use proper assert* methods in test.
This remove PendingDeprecationWarnings.
2013-04-04 14:15:24 +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
Jacek Tomaszewski
45943d8ee1 Remove dead code from tests. 2013-04-02 23:30:40 +02:00
Jacek Tomaszewski
fef3109e60 Fix test running in Django 1.6: foreignkey support (close #169). 2013-04-02 23:27:21 +02:00
Jacek Tomaszewski
264b917081 Fix test running in Django 1.6: model opts function caching. 2013-04-02 22:36:37 +02:00
Jacek Tomaszewski
54a2ad043f Fix test running in Django 1.6: boolean field default. 2013-04-02 11:46:05 +02:00
Jacek Tomaszewski
6c07b18152 Fix Django 1.5 metaclass retrieval (ref #166). 2013-04-02 11:42:57 +02:00
Jacek Tomaszewski
32e945e28b Handle non-translation form submision for translated models (close #167). 2013-04-02 09:51:44 +02:00
Jacek Tomaszewski
07f7164289 Handle only/defer manager methods (close #166). 2013-04-02 09:51:44 +02:00
Jacek Tomaszewski
ce167e3256 Fix test for #154. 2013-04-02 09:51:44 +02:00
deschler
72e2724e5a Turned off modeltranslation debug by default (ref #158). 2013-03-30 22:48:13 +01: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
wrwrwr
b00a1044c6 Flake8, overindented continuation line. 2013-03-17 17:43:24 +01:00
wrwrwr
627c2b55e9 Added a fallback_undefined option to allow customizing the value that triggers falling back. 2013-03-17 17:35:22 +01:00
wrwrwr
740cfea50d Test for the nullable CharField case. 2013-03-17 11:25:42 +01:00
wrwrwr
7d209ae4e3 Only fallback when there is no value for a given translation or the value is the field's default.
For CharField(null=True) the default is None, so empty string becomes a proper value (it's sometimes useful to treat it differently than None).
2013-03-17 11:24:24 +01:00