Commit graph

66 commits

Author SHA1 Message Date
Jacek Tomaszewski
7a7b3fbc3b Rewrite field names in select_related; fix deffered models registry lookup (close #248). 2014-07-06 19:36:46 +02:00
Jacek Tomaszewski
58e06c464d Fix MultilingualManager MRO (close #204). 2014-07-06 14:39:53 +02:00
Jacek Tomaszewski
41f8c68ed4 Update docs; fix type coercion. 2014-06-21 23:36:01 +02:00
Jacek Tomaszewski
2cd9467716 Fix ProxyModel handling. 2014-06-09 23:32:22 +02:00
Jacek Tomaszewski
f6087cf3fa Detect custom get_queryset on managers (ref #242). 2014-05-12 17:41:07 +02:00
Jacek Tomaszewski
5ed3a2696b Don't set use_for_related_fields unconditionally on all managers (ref #242). 2014-05-06 21:59:21 +02:00
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