Commit graph

81 commits

Author SHA1 Message Date
Jacek Tomaszewski
cbfb1563a2 Remove `_populate` keyword.
Other ways of managing population are preferred and more elegant.
2013-02-19 18:03:41 +01:00
Jacek Tomaszewski
176f4aeeb1 Refactor auto-populating: move code to constructor.
Constructor is better place than pre_save signal since it
has access to all passed arguments (field names).
Also reenabled broken test.
2013-02-19 10:48: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
057a34e2a0 Removed accidentally committed decorator leftover. 2013-02-15 01:00:09 +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
Dirk Eschler
c06134bff4 Merge branch 'master' of github.com:deschler/django-modeltranslation 2013-02-13 12:21:27 +01:00
Dirk Eschler
83a6333cd2 Added admin test for readonly fields only. 2013-02-13 12:21:21 +01:00
Jacek Tomaszewski
f7759ba75a Extract number of registered test models as constant. 2013-02-13 12:01:54 +01:00
Jacek Tomaszewski
14fdaa59fa Add descriptor test. 2013-02-13 11:59:11 +01:00
Dirk Eschler
4ca3c103e5 Fixed prepopulated fields only work on the first defined field and made function aware of the current language. Added a unittest to verify. Resolves issue #57. 2013-02-12 15:53:00 +01:00
Dirk Eschler
966d5ee962 Added unittest for group-fieldsets functionality in TranslationAdmin. 2013-02-12 12:20:32 +01:00
Dirk Eschler
48ceae54b7 Added admin test for multitable inheritance to verify that issue #50 was resolved by pull request #137. 2013-02-11 12:16:03 +01:00
Dirk Eschler
8ff3b3731a Fixed messed up multitable test model names. 2013-02-11 11:53:01 +01:00
wrwrwr
36c5d0b81a Test registration and translation fields inheritance with a more complex model hierarchy (inspired by Mezzanine). 2013-02-10 18:32:17 +01:00
Jacek Tomaszewski
8a20600d3a Flake8 fix. 2013-02-09 22:46:11 +01:00
Jacek Tomaszewski
3fa3d653d0 Remove unnecessary test methods. 2013-02-09 22:34:36 +01:00
Jacek Tomaszewski
09036c0946 Fix autodiscover tests. 2013-02-09 22:33:49 +01:00
Jacek Tomaszewski
458f3e2f8e Damned Python 2.5 decorators. 2013-02-09 20:49:54 +01:00
Jacek Tomaszewski
9871e64ea6 Add autodiscover tests. 2013-02-09 20:35:34 +01:00
Dirk Eschler
f0602b9dcc Merge pull request #134 from wrwrwr/feature/starting-underscore-tabbed-admin-fix
Fix CSS class generation for fields starting with an underscore
2013-02-03 08:17:54 -08:00
Jacek Tomaszewski
3c9bae241e Fix descending order rewriting in all ordering calls. 2013-02-03 15:08:24 +01:00
Jacek Tomaszewski
18e70bb4e1 Merge pull request #133 from wrwrwr/feature/descending-order-with-translation-fix
Fix ``order_by`` on descending translation field
2013-02-03 05:36:02 -08:00
wrwrwr
c6c866ba70 Flake8, remove unused variables. 2013-02-03 14:24:02 +01:00
wrwrwr
b42a9142ac Added a simple test that catches the descending order problem. 2013-01-31 17:42:20 +01:00
Jacek Tomaszewski
dbc114f228 Allow descriptor introspection.
(See Django #8248 for details,
http://code.djangoproject.com/ticket/8248)
2013-01-29 19:54:23 +01:00
wrwrwr
8ebc7a828e Test that CSS classes names are built properly. 2013-01-24 13:05:51 +01:00
Jacek Tomaszewski
865f451953 Fix MultilingualQUerySet custom inheritance. 2013-01-07 18:02:15 +01:00
Jacek Tomaszewski
00210c14ba Fix for mysql. 2012-12-31 13:47:57 +01:00
Jacek Tomaszewski
f13bcdbebc Add test concerning update_translation_fields command. 2012-12-31 13:12:03 +01:00
Jacek Tomaszewski
91db5d2ff7 Fix translation registry in tests. 2012-12-31 13:08:50 +01:00
Jacek Tomaszewski
0c0edb4aaf New rule3 test. 2012-12-07 13:14:05 +01:00
Jacek Tomaszewski
85164b2ff2 Fix ContentFile usage to be Django 1.3 compatible. 2012-12-06 18:38:51 +01:00
Jacek Tomaszewski
5085f7e111 Refactor tests: create default_fallback context manager. 2012-12-06 18:09:03 +01:00
Jacek Tomaszewski
6947814e2a Refactor tests: refactor ModelValidationTest. 2012-12-06 17:59:28 +01:00
Jacek Tomaszewski
c065485d53 Refactor tests: refactor all RulesTests. 2012-12-06 17:08:17 +01:00
Jacek Tomaszewski
b8556ea952 Refactor tests: refactor OtherFieldsTest. 2012-12-06 14:43:06 +01:00
Jacek Tomaszewski
7347141f50 Refactor tests: refactor FileFieldsTest. 2012-12-06 14:17:57 +01:00
Jacek Tomaszewski
f0d6a955de Refactor tests: refactor first TestCase. 2012-12-06 13:57:11 +01:00
Jacek Tomaszewski
ef7930feb9 Fix flake8 warnings. 2012-12-06 13:57:11 +01:00
Jacek Tomaszewski
278913fac7 Refactor tests: use package-level import for models. 2012-12-06 12:46:27 +01:00
Jacek Tomaszewski
dbc3e1b358 Refactor tests: use package-level import for admin. 2012-12-06 12:42:59 +01:00
Dirk Eschler
2257fb0aa2 Enhanced admin tests for grouped fields inside a fieldsets definition. 2012-11-20 20:51:17 +01:00
Dirk Eschler
ee380ec7b7 Handled nested lists to display multiple fields on same line by flatting them. 2012-11-20 01:02:12 +01:00
Dirk Eschler
e8355b0e94 Enhanced admin tests for readonly_fields. 2012-11-18 22:00:43 +01:00
Dirk Eschler
5affe7940c Added basic tests for DateField, DateTimeField and TimeField and added them to the list of supported fields. 2012-11-18 00:08:04 +01:00
Dirk Eschler
5088f591fd Disabled the test for GenericIPAddressField for now as it new in Django 1.4 and the tests will fail with 1.3. That said we don't expect any different behaviour from this field compared to IPAddressField. 2012-11-17 17:12:24 +01:00
Dirk Eschler
1163765c3b Increased the list of supported fields. Today featuring: Floatfield, DecimalField, IPAddressField and GenericIPAddressField. 2012-11-17 16:19:15 +01:00
Dirk Eschler
b20496cb22 Merge pull request #113 from zlorf/metaclass_field_aggregation
TranslationOptions fields inheritance
2012-11-15 13:54:21 -08:00
Dirk Eschler
2e4265324d Added test for CommaSeparatedIntegerField and noted that it's implicitly supported as a subclass of CharField. 2012-11-15 21:29:02 +01:00