Jacek Tomaszewski
709c993c07
Fix new code to be Python 3 compatible.
2014-03-18 20:31:21 +01:00
Dirk Eschler
591e945c33
Add more control over required languages ( close #143 ).
2014-03-15 15:18:52 +01:00
Jacek Tomaszewski
b313793490
Use _default_manager instead of objects; patch _default_manager as well.
2014-03-13 19:58:03 +01:00
Jacek Tomaszewski
a15b6f8949
Fixes for flake8.
2014-01-19 22:30:45 +01:00
Jacek Tomaszewski
f97695ac5a
Connect signal only for registered model, not all.
2014-01-19 22:13:43 +01:00
Jacek Tomaszewski
c27a4e4e10
Fix form submission ( close #219 ).
2013-12-26 18:59:24 +01:00
Jacek Tomaszewski
42128390e6
Fix proxy model handling.
...
Previously, proxy models would receive transaltion fields twice, as inspeceted by model._meta.get_fields_with_model()
2013-11-09 16:18:47 +01:00
Jacek Tomaszewski
410888517e
Fix abstract managers patching ( close #212 ).
2013-11-09 16:03:25 +01: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
7024268836
Handle proxy models ( close #206 ).
2013-10-12 17:31:18 +02:00
Jacek Tomaszewski
0e76f1ec7d
Add OneToOneField support.
2013-10-12 13:58:57 +02:00
Jacek Tomaszewski
81638809bc
Fix form handling in case of excluded translated field ( close #183 ).
2013-10-11 20:07:37 +02:00
Jacek Tomaszewski
73d845921a
Make every manager MultiLingual, not only objects ( close #198 ).
2013-10-10 15:27:27 +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
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
Jacek Tomaszewski
264b917081
Fix test running in Django 1.6: model opts function caching.
2013-04-02 22:36:37 +02:00
Jacek Tomaszewski
6c07b18152
Fix Django 1.5 metaclass retrieval (ref #166 ).
2013-04-02 11:42:57 +02:00
Jacek Tomaszewski
07f7164289
Handle only/defer manager methods ( close #166 ).
2013-04-02 09:51:44 +02: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
Jacek Tomaszewski
5feff41795
Change the form of `related_query_name` for implicit related_names (ref #161 ).
2013-03-13 19:24:00 +01:00
Jacek Tomaszewski
fccdf93577
Finish ForeignKey reverse relation handling (ref #161 ).
...
Also enhance tests and refactor MultilingualManager rewriting of
spanned relations lookups.
2013-03-13 15:50:22 +01:00
Braden MacDonald
16de24183a
Add a descriptor so that ForeignKey 'field_id' attributes work.
2013-03-06 15:54:56 -08:00
Jacek Tomaszewski
f238d6b00d
Remove old commented code.
2013-02-19 18:18:48 +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
wrwrwr
ce59c16e4f
Flake8, unused variable and import.
2013-02-10 19:05:59 +01:00
wrwrwr
11045e8ffb
Small cleanup in `FieldsAggregationMetaClass`. The manual inheritance syntax is left mostly for backwards compatibility.
2013-02-10 18:32:22 +01:00
wrwrwr
30b6768f0f
Refactor translation options to be able to keep track of translation fields inherited from concrete supermodels and find fields inherited indirectly (through unregistered parents). Ensure that a base is not registered after or unregistered before submodel (that would necessitate repatching the submodel).
...
This changes how _registry looks, now info about all seen models is stored (including unregistered ascendants of registered models), to avoid recomputing parents options when determining translation fields of a submodel. ``TranslationOption`` instances have just two dictionaries of fields: ``local_fields`` (similar to the former ``localized_fieldnames``) and ``fields`` to match Django naming and precompute only what's necessary.
2013-02-10 18:23:35 +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
Jacek Tomaszewski
865f451953
Fix MultilingualQUerySet custom inheritance.
2013-01-07 18:02:15 +01:00
Jacek Tomaszewski
0ede18c0c5
Fix field aggregation.
2012-11-15 20:34:20 +01:00
Bruno Tavares
2431e2a21a
field aggregation when subclassing a TranslationOption
2012-11-15 18:26:56 +00:00
Jacek Tomaszewski
5b51a7b793
Add fallback language feature and base tests.
2012-11-13 16:28:42 +01:00
Jacek Tomaszewski
df02c81207
Disable rule 3
...
Merge branch 'upstream/no-rule3' into 'master'
2012-11-12 19:32:50 +01:00
Dirk Eschler
9675b2eb84
Satisfied flake8.
2012-11-12 15:32:11 +01:00
Jacek Tomaszewski
71364966a5
Make model constructor rewrite fields in kwargs.
2012-11-12 12:54:10 +01:00
Jacek Tomaszewski
0949e95441
Add MultilingualManager and its tests.
2012-11-11 16:28:29 +01:00
Jacek Tomaszewski
e170a2f733
Fix registration error.
...
Due to bad intendation the registration for list of models would fail.
2012-11-11 00:54:49 +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
10c9a95da6
Fixed dynamic TranslationOptions model name.
2012-07-11 12:28:30 +00:00
Dirk Eschler
4afb04b75a
Moved autoregistration code to init and merged related changes from hyperweek's branch at github . This eliminates the need for hooking into urls.py.
2012-07-11 09:52:49 +00:00
Dirk Eschler
de1441414c
Restored debug output which formerly lived in models.py and added it to autoregister.
2012-07-10 15:47:57 +00:00
Dirk Eschler
4579d831e5
Use app-level translation files in favour of a single project-level one. Adds an autoregister feature similiar to the one provided by Django's admin. A new setting MODELTRANSLATION_TRANSLATION_FILES keeps backwards compatibility with older versions. This is basically a merge from django-modeltranslation-wrapper with a few changes regarding how registration is triggered. See documentation for details. Resolves issues 58 and 71 (thanks to Jacek Tomaszewski, the author of modeltranslation-wrapper).
2012-07-10 12:58:08 +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
7b79b3c4d9
Added support for multi-table inheritance. Resolves issues 50 and 51 (thanks to Sébastien Fievet).
2011-06-01 15:25:40 +00:00
Dirk Eschler
f525e1e2c0
Removed experimental support for related fields. The code is now available in a separate branch called django-modeltranslation-related-fields. To support related fields properly, deeper changes to the core of modeltranslation are required. These changes are beyond the scope of the next release.
2010-09-06 12:29:23 +00:00