Commit graph

62 commits

Author SHA1 Message Date
Jacek Tomaszewski
b8cf1ef015 Fix db_column (close #210). 2013-10-18 10:46:15 +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
656dca3e40 Show None checkboxes on form fields, especially admin (close #187). 2013-10-10 23:05:26 +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
Jacek Tomaszewski
fef3109e60 Fix test running in Django 1.6: foreignkey support (close #169). 2013-04-02 23:27:21 +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
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
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
Jacek Tomaszewski
47cc2cb1b7 Fix flake8 2013-03-13 23:52:44 +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
43a61a0bcc Add tests for foreign key reverse relations, and fix some issues. Still incomplete. ref deschler/django-modeltranslation#161 2013-03-10 16:39:14 -07:00
Jacek Tomaszewski
fc798eaeb4 Attempt to rewrite related_names (ref #161). 2013-03-08 21:13:37 +01:00
Braden MacDonald
16de24183a Add a descriptor so that ForeignKey 'field_id' attributes work. 2013-03-06 15:54:56 -08:00
Braden MacDonald
420e3b6c52 Implement ForeignKey support (does not support reverse relations) 2013-03-06 14:20:16 -08:00
Jacek Tomaszewski
38ff4a28ea Refactor fix for #154 and add a test. 2013-02-27 20:02:23 +01:00
Jacek Tomaszewski
26b904ef7e Hotfix for #154 2013-02-26 23:17:19 +01:00
wrwrwr
7ff0506f27 Context manager for temporarily switching fallbacks on or off. 2013-02-24 11:01:08 +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
dbc114f228 Allow descriptor introspection.
(See Django #8248 for details,
http://code.djangoproject.com/ticket/8248)
2013-01-29 19:54:23 +01:00
Dirk Eschler
56926d5801 Fixed db_column option not taken into account. Resolves issue #83. 2012-11-18 15:30:34 +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
4abf2dbb6f Marked FilePathField as an implicitly supported field as it is a subclass of CharField. 2012-11-17 23:00:57 +01:00
Dirk Eschler
0f3a89cf39 Handled GenericIPAddressField which is only present in Django 1.4+. 2012-11-17 17:35:21 +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
Jacek Tomaszewski
261818de8b Refactor SUPPORTED_FIELDS: delete IntegerField subclasses. 2012-11-15 20:53:24 +01:00
Bruno Tavares
940b8911b1 Clean up the namespace imports 2012-11-15 10:30:03 +00:00
Dirk Eschler
7dd3891821 Added support and basic tests for BooleanField and NullBooleanField. 2012-11-14 23:37:45 +01:00
Dirk Eschler
825cbe38da Refactored TranslationField. Removed method overrides which are obsoleted by the the field_factory. 2012-11-14 22:43:42 +01:00
Dirk Eschler
93db5f109b Reflected baseclass name of returned subclass in field factory. 2012-11-14 14:18:38 +01: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
Jacek Tomaszewski
a043680a68 Add Integer fields support. 2012-11-11 15:52:12 +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
a3db814551 Added unittest for FileField and ImageField and incorporated a small fix for the pre_save method of TranslationField (thanks to Bruno Tavares). 2012-10-12 12:59:52 +00:00
Dirk Eschler
abea9835a7 Added support for FileField and ImageField. Resolves issue 30 (thanks to Bruno Tavares and Maxime Haineault). 2012-10-12 08:27:22 +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
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
Dirk Eschler
63fd7c0c7c Changed handling of supported fields. By default CharField, TextField and subclasses of these fields are supported. Supported fields can be extended through the setting MODELTRANSLATION_CUSTOM_FIELDS. Support for related fields is experimental and these fields explicitly raise a FutureWarning now. 2010-08-27 08:39:41 +00:00
Dirk Eschler
edc82d9d8f Used attname as key in pre_save which adds the _id prefix for related fields automatically. Raised an experimental warning for related fields. 2010-07-06 15:34:22 +00:00
Dirk Eschler
974503ca0a Moved determination of default language into settings. 2010-07-06 09:52:41 +00:00
Dirk Eschler
a1bd45eaa9 Fixed Python 2.4 incompatibility. Resolves issue 40. 2010-07-05 18:55:05 +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