Commit graph

46 commits

Author SHA1 Message Date
Sergey Tereschenko
7a8a96ba18 chore(flake8): Fix linter errors. 2020-07-10 09:19:01 +03:00
Tim Gates
01a41783cb
docs: Fix simple typo, splitable -> splittable
There is a small typo in modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js, modeltranslation/utils.py.

Should read `splittable` rather than `splitable`.
2020-03-24 19:29:02 +11:00
Sergey Tereschenko
da5d8c91ba fix flake8 warnings 2020-02-14 17:27:12 +02:00
Adrian Berger
a7c0482b94 replace force_text to support django 3 2020-01-07 11:13:45 +01:00
Sergey Tereschenko
686e020974 Change permissions to 644 2019-12-18 00:30:13 +02:00
Misha Kalyna
5505208003 explicitly install and import six (which was removed from Django 3.0) 2019-10-05 21:07:08 +02:00
Dirk Eschler
49836c210d Satisfied flake8. 2017-11-24 15:14:40 +01:00
Ben Lopatin
2438300915
Add docstring documentation for utils.unique 2017-10-28 20:56:49 -04:00
oliphunt
28eb14e4fa CS fixes. 2015-05-26 12:18:45 +01:00
oliphunt
9480dba1c5 Add mt-bidi class to input fields for bi-directional languages. 2015-05-21 12:54:38 +01:00
Jacek Tomaszewski
d8e6f32cbd Django 1.8 compatibility changes (ref #299).
Thanks to Luca Corti for initial commit.
2015-04-13 00:43:09 +02:00
wrwrwr
902a7c9a72 Fixed Indonesian translation field and ForeignKey field name clash.
The official ISO-639-1 code for Indonesia is "id"; replaced this
problematic suffix with the ISO-639-2 3-letter code in the translation
field names (http://en.wikipedia.org/wiki/Indonesian_language).
2014-10-24 13:05:10 +02:00
Jacek Tomaszewski
71af06c7c9 Add configurable formfields (close #211, ref #163, #187).
This will hopefully at last resolve the problem with nullable CharFields.
2013-10-23 15:40:45 +02:00
Jacek Tomaszewski
b7ea1fac4c Further work towards Python 3 support. 2013-04-08 11:41:06 +02:00
Kudlaty
966c0f38ad Initial work towards python 3 support 2013-04-08 11:41:06 +02:00
wrwrwr
7ff0506f27 Context manager for temporarily switching fallbacks on or off. 2013-02-24 11:01:08 +01:00
wrwrwr
f168b55737 Apply population using a pre_save signal.
It can be used with ``get_or_create`` (without resaving) and, more importantly, fixture loading.
Extend population by providing two new modes: ``default`` that sets just the default translation (only if its not given; ensuring a fallback is available; alike ``update_translation_fields``) and ``required`` that further limits population by only filling default translation of non-nullable fields (minimum to keep some level of consistency).
Add a ``populate(mode)`` toggle on multilingual query set / manager and an ``auto_populate``  context manager for fixture loading.
2013-02-19 10:47:25 +01:00
Jacek Tomaszewski
079f745621 Small refactor in _join_css_class and its test. 2013-02-15 11:08:37 +01:00
deschler
f8c5d46b7a Simplified checks in _join_css_class and updated test to reflect the change (issue #141). 2013-02-15 00:57:55 +01:00
deschler
83b133049d Fixed _join_css_class() doesn't take settings.LANGUAGES into account and fails with 'en-us'. Resolves issue #141. 2013-02-14 22:15:00 +01:00
Dirk Eschler
e94bbcd3d2 Applied styleguide. We allow 100 chars now, let's use the space. 2013-02-06 11:52:46 +01:00
wrwrwr
715b13a1e9 Do generate CSS class name for fields starting with an underscore (still seems to work with two-part codes). 2013-01-24 13:05:44 +01:00
Jacek Tomaszewski
5b51a7b793 Add fallback language feature and base tests. 2012-11-13 16:28:42 +01:00
Jacek Tomaszewski
86cb1e0de2 Use namespaced settings values in utils. 2012-11-13 16:03:09 +01:00
Dirk Eschler
3acfa09dbc - Validated codebase against pep8 and pyflakes.
- Fixed an undefined name bug in add_localized_fields error message when a model already has a field by the name that is added.
- Fixed redefined method name in ModeltranslationWithFileFields test class.
2012-10-24 11:06:35 +02:00
Dirk Eschler
9d58478b2e Fixed tabs don't properly support two-part language codes. Resolves issue 63. 2012-10-19 13:32:33 +02:00
Dirk Eschler
5d0afa21bd Fixed non-unicode verbose field names (with actual unicode characters) showing up empty in forms. Resolves issue 35. 2012-07-11 20:24:37 +00:00
Dirk Eschler
6f7704bc57 Some cleanups and validated codebase against PEP8 and coding guidelines. 2012-07-04 10:09:22 +00:00
Dirk Eschler
1c8e82890d Major refactoring of the admin integration. Subclassed BaseModelAdmin and InlineModelAdmin. Patching options in init doesn't seem to be thread safe. Instead used provided hooks like get_form, get_formset and get_fieldsets. This should resolve several problems with the exclude and fieldsets options and properly support options in inlines. Added a new admin option exclude_languages to exclude certain translation fields per admin class. Moved tests to separate folder and added tests for TranslationAdmin. To run the tests the settings provided in model.tests.modeltranslation have to be used (settings.LANGUAGES override doesn't work for TranslationAdmin). 2012-07-04 09:29:05 +00:00
Dirk Eschler
39262a8a02 Fixed a bug in the admin integration where an emptied default language field (which has been defined with "blank=True") hasn't cleared the default field. Resolves issue 47. 2011-04-10 20:27:24 +00:00
Dirk Eschler
974503ca0a Moved determination of default language into settings. 2010-07-06 09:52:41 +00:00
Dirk Eschler
adc7af11d3 Fixed fieldname isn't ensured to be string. Resolves issue 41 (thanks martyn.clement). 2010-06-30 19:37:37 +00:00
Dirk Eschler
77350b1e89 Factored out settings into a separate settings.py and consistently used an app specific settings prefix, TRANSLATION_REGISTRY now deprecated in favour of MODELTRANSLATION_TRANSLATION_REGISTRY. 2010-06-26 08:54:08 +00:00
Dirk Eschler
406abfb89f Refactored creation of translation fields. Added a factory to handle the creation of translation fields. The factory also checks if a field is officially supported by modeltranslation and bails out early in case it doesn't. Resolves issue 37. 2010-06-24 13:24:03 +00:00
Dirk Eschler
5d5bf067ad Handle related fields in field descriptor (work in progress, issue 36). 2010-06-22 22:02:16 +00:00
Dirk Eschler
006239a68e Restored handling of KeyError raised by ForeignKeyTanslationField. 2010-06-21 20:26:52 +00:00
Dirk Eschler
0ac39fba8c Added configurable default value per field instance. Resolves issue 28 (thanks to bmihelac). 2010-06-21 13:38:34 +00:00
Dirk Eschler
9b68efda05 Added setting to override the default language. Resolves issue 2. 2010-06-21 09:43:41 +00:00
Dirk Eschler
b8fab905dc Fixed TranslationField pre_save does not get the default language correctly. Factored out determination of default language. Resolves issue 31 (thanks to jaap). 2010-06-17 14:33:39 +00:00
Dirk Eschler
2e4a85e791 Added support for related fields - ForeignKey, ManyToManyField and OneToOneField. Resolves issue 15. 2010-06-15 12:39:04 +00:00
Dirk Eschler
76e04858cd Fixed verbose names of translated fields are not translated. Resolves issue 24 (thanks to carl.j.meyer). 2010-05-26 09:14:00 +00:00
Dirk Eschler
3f4a6eb472 Validated codebase against pep8. 2010-04-19 10:52:57 +00:00
Dirk Eschler
6220314bc1 Code cleanups. 2010-03-02 22:17:39 +00:00
Dirk Eschler
68215e5cbb Fixed broken admin fields and fieldsets. Resolves issue 9 (thanks to simoncelen). 2010-02-23 14:20:42 +00:00
Dirk Eschler
325837b742 Fixed creation of db fields with invalid python language code, resolving #4 (thanks to carl.j.meyer). 2010-02-16 10:47:57 +00:00
Peter Eschler
73ee7db101 Initial source and metadata import. 2009-02-17 21:08:19 +00:00